Web site translator - Java Swing O Reilly Equivalent to paint(g). This
Java Swing O Reilly Equivalent to paint(g). This is significantly different from the update() method of Component, which first cleared the component’s background. In Swing, clearing the component is handled by ComponentUI, based on whether the component is opaque. public boolean contains(int x, int y) Returns true if the coordinates passed in are inside the bounding box of the component, false otherwise. The method always asks the UI delegate first, giving it an opportunity to define the bounding box as it sees fit. If the UI delegate does not exist for this component, or cannot define the bounding box, the standard component contains() method is invoked. publicInsets getInsets (Insets insets) Copies the JComponent’s insets into the given Insets object, and returns a reference to this object. public void paint(Graphics g) The primary method that the AWT subsystem calls upon for components to draw themselves if they are not obscured. This method delegates most of its work to the protected methods paintComponent(), paintBorder(), and paintChildren(), which it calls in that order. Because this method performs its own internal calculations, it is generally not a good idea to override it in a subclass; if you want to redefine how a component draws itself, override paintComponent() instead. public void reshape(int x, int y, int w, int h) Resets the bounds property of the component. protected void paintComponent(Graphics g) Draws the component using the graphics context provided. Unless overridden, it simply turns around and calls the paint() method of the delegate. If there is no delegate, the method does nothing. protected void paintChildren(Graphics g) Cycles through each of the component’s children, invoking the paint() method on each one. protected void paintBorder(Graphics g) Paints the border (or borders) outlined in by the border property of JComponent. Note that if a border is defined, JComponent ignores its own insets and uses the border instead. public void repaint(long tm, int x, int y, int width, int height) public void repaint(Rectangle r) These methods place a request to repaint the specified region on the repaint manager’s update queue. The initial variable tm of the first repaint() method is no longer used and can be ignored. Because the redrawing queue knows the correct order to draw various - 70 -
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check Vision professional web hosting services