JavaTM 2 Platform
Standard Ed. 5.0

Uses of Class
java.awt.Graphics

Packages that use Graphics
java.awt Contains all of the classes for creating user interfaces and for painting graphics and images. 
java.awt.image Provides classes for creating and modifying images. 
java.awt.print Provides classes and interfaces for a general printing API. 
java.beans Contains classes related to developing beans -- components based on the JavaBeansTM architecture. 
javax.swing Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms. 
javax.swing.border Provides classes and interface for drawing specialized borders around a Swing component. 
javax.swing.colorchooser Contains classes and interfaces used by the JColorChooser component. 
javax.swing.plaf Provides one interface and many abstract classes that Swing uses to provide its pluggable look-and-feel capabilities. 
javax.swing.plaf.basic Provides user interface objects built according to the Basic look and feel. 
javax.swing.plaf.metal Provides user interface objects built according to the Java look and feel (once codenamed Metal), which is the default look and feel. 
javax.swing.plaf.multi Provides user interface objects that combine two or more look and feels. 
javax.swing.plaf.synth Synth is a skinnable look and feel in which all painting is delegated. 
javax.swing.text Provides classes and interfaces that deal with editable and noneditable text components. 
javax.swing.text.html Provides the class HTMLEditorKit and supporting classes for creating HTML text editors. 
javax.swing.tree Provides classes and interfaces for dealing with javax.swing.JTree
 

Uses of Graphics in java.awt
 

Subclasses of Graphics in java.awt
 class Graphics2D
          This Graphics2D class extends the Graphics class to provide more sophisticated control over geometry, coordinate transformations, color management, and text layout.
 

Methods in java.awt that return Graphics
abstract  Graphics Graphics.create()
          Creates a new Graphics object that is a copy of this Graphics object.
 Graphics Graphics.create(int x, int y, int width, int height)
          Creates a new Graphics object based on this Graphics object, but with a new translation and clip area.
 Graphics Component.FlipBufferStrategy.getDrawGraphics()
           
 Graphics Component.BltBufferStrategy.getDrawGraphics()
           
abstract  Graphics PrintJob.getGraphics()
          Gets a Graphics object that will draw to the next page.
abstract  Graphics Image.getGraphics()
          Creates a graphics context for drawing to an off-screen image.
 Graphics Component.getGraphics()
          Creates a graphics context for this component.
 

Methods in java.awt with parameters of type Graphics
 LineMetrics FontMetrics.getLineMetrics(char[] chars, int beginIndex, int limit, Graphics context)
          Returns the LineMetrics object for the specified character array in the specified Graphics context.
 LineMetrics FontMetrics.getLineMetrics(CharacterIterator ci, int beginIndex, int limit, Graphics context)
          Returns the LineMetrics object for the specified CharacterIterator in the specified Graphics context.
 LineMetrics FontMetrics.getLineMetrics(String str, Graphics context)
          Returns the LineMetrics object for the specified String in the specified Graphics context.
 LineMetrics FontMetrics.getLineMetrics(String str, int beginIndex, int limit, Graphics context)
          Returns the LineMetrics object for the specified String in the specified Graphics context.
 Rectangle2D FontMetrics.getMaxCharBounds(Graphics context)
          Returns the bounds for the character with the maximum bounds in the specified Graphics context.
 Rectangle2D FontMetrics.getStringBounds(char[] chars, int beginIndex, int limit, Graphics context)
          Returns the bounds of the specified array of characters in the specified Graphics context.
 Rectangle2D FontMetrics.getStringBounds(CharacterIterator ci, int beginIndex, int limit, Graphics context)
          Returns the bounds of the characters indexed in the specified CharacterIterator in the specified Graphics context.
 Rectangle2D FontMetrics.getStringBounds(String str, Graphics context)
          Returns the bounds of the specified String in the specified Graphics context.
 Rectangle2D FontMetrics.getStringBounds(String str, int beginIndex, int limit, Graphics context)
          Returns the bounds of the specified String in the specified Graphics context.
 void Canvas.paint(Graphics g)
          Paints this canvas.
 void Component.paint(Graphics g)
          Paints this component.
 void Container.paint(Graphics g)
          Paints the container.
 void Component.paintAll(Graphics g)
          Paints this component and all of its subcomponents.
 void Container.paintComponents(Graphics g)
          Paints each of the components in this container.
 void Component.print(Graphics g)
          Prints this component.
 void Container.print(Graphics g)
          Prints the container.
 void Component.printAll(Graphics g)
          Prints this component and all of its subcomponents.
 void ScrollPane.printComponents(Graphics g)
          Prints the component in this scroll pane.
 void Container.printComponents(Graphics g)
          Prints each of the components in this container.
 void Canvas.update(Graphics g)
          Updates this canvas.
 void Component.update(Graphics g)
          Updates this component.
 void Container.update(Graphics g)
          Updates the container.
 

Uses of Graphics in java.awt.image
 

Methods in java.awt.image that return Graphics
abstract  Graphics BufferStrategy.getDrawGraphics()
           
 Graphics BufferedImage.getGraphics()
          This method returns a Graphics2D, but is here for backwards compatibility.
 Graphics VolatileImage.getGraphics()
          This method returns a Graphics2D, but is here for backwards compatibility.
 

Uses of Graphics in java.awt.print
 

Methods in java.awt.print with parameters of type Graphics
 int Printable.print(Graphics graphics, PageFormat pageFormat, int pageIndex)
          Prints the page at the specified index into the specified Graphics context in the specified format.
 

Uses of Graphics in java.beans
 

Methods in java.beans with parameters of type Graphics
 void PropertyEditorSupport.paintValue(Graphics gfx, Rectangle box)
          Paint a representation of the value into a given area of screen real estate.
 void PropertyEditor.paintValue(Graphics gfx, Rectangle box)
          Paint a representation of the value into a given area of screen real estate.
 

Uses of Graphics in javax.swing
 

Subclasses of Graphics in javax.swing
 class DebugGraphics
          Graphics subclass supporting graphics debugging.
 

Methods in javax.swing that return Graphics
 Graphics DebugGraphics.create()
          Overrides Graphics.create to return a DebugGraphics object.
 Graphics DebugGraphics.create(int x, int y, int width, int height)
          Overrides Graphics.create to return a DebugGraphics object.
protected  Graphics JComponent.getComponentGraphics(Graphics g)
          Returns the graphics object used to paint this component.
 Graphics JComponent.getGraphics()
          Returns this component's graphics context, which lets you draw on a component.
 

Methods in javax.swing with parameters of type Graphics
protected  Graphics JComponent.getComponentGraphics(Graphics g)
          Returns the graphics object used to paint this component.
 void JViewport.paint(Graphics g)
          Depending on whether the backingStore is enabled, either paint the image through the backing store or paint just the recently exposed part, using the backing store to "blit" the remainder.
 void CellRendererPane.paint(Graphics g)
          Shouldn't be called.
 void JLayeredPane.paint(Graphics g)
          Paints this JLayeredPane within the specified graphics context.
 void JComponent.paint(Graphics g)
          Invoked by Swing to draw components.
protected  void JProgressBar.paintBorder(Graphics g)
          Paints the progress bar's border if the borderPainted property is true.
protected  void JToolBar.paintBorder(Graphics g)
          Paints the tool bar's border if the borderPainted property is true.
protected  void JPopupMenu.paintBorder(Graphics g)
          Paints the popup menu's border if the borderPainted property is true.
protected  void AbstractButton.paintBorder(Graphics g)
          Paint the button's border if BorderPainted property is true and the button has a border.
protected  void JMenuBar.paintBorder(Graphics g)
          Paints the menubar's border if BorderPainted property is true.
protected  void JComponent.paintBorder(Graphics g)
          Paints the component's border.
protected  void JSplitPane.paintChildren(Graphics g)
          Subclassed to message the UI with finishedPaintingChildren after super has been messaged, as well as painting the border.
protected  void JComponent.paintChildren(Graphics g)
          Paints this component's children.
protected  void JInternalFrame.paintComponent(Graphics g)
          Overridden to allow optimized painting when the internal frame is being dragged.
protected  void JComponent.paintComponent(Graphics g)
          Calls the UI delegate's paint method, if the UI delegate is non-null.
 void CellRendererPane.paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h)
          Calls this.paintComponent(g, c, p, x, y, w, h, false).
static void SwingUtilities.paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h)
          Paints a component c on an arbitrary graphics g in the specified rectangle, specifying the rectangle's upper left corner and size.
 void CellRendererPane.paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate)
          Paint a cell renderer component c on graphics object g.
 void CellRendererPane.paintComponent(Graphics g, Component c, Container p, Rectangle r)
          Calls this.paintComponent() with the rectangles x,y,width,height fields.
static void SwingUtilities.paintComponent(Graphics g, Component c, Container p, Rectangle r)
          Paints a component c on an arbitrary graphics g in the specified rectangle, specifying a Rectangle object.
 void ImageIcon.paintIcon(Component c, Graphics g, int x, int y)
          Paints the icon.
 void Icon.paintIcon(Component c, Graphics g, int x, int y)
          Draw the icon at the specified location.
 void JComponent.print(Graphics g)
          Invoke this method to print the component.
 void JComponent.printAll(Graphics g)
          Invoke this method to print the component.
protected  void JComponent.printBorder(Graphics g)
          Prints the component's border.
protected  void JComponent.printChildren(Graphics g)
          Prints this component's children.
protected  void JComponent.printComponent(Graphics g)
          This is invoked during a printing operation.
 void JApplet.update(Graphics g)
          Just calls paint(g).
 void JDialog.update(Graphics g)
          Calls paint(g).
 void JWindow.update(Graphics g)
          Calls paint(g).
 void CellRendererPane.update(Graphics g)
          Shouldn't be called.
 void JComponent.update(Graphics g)
          Calls paint.
 void JFrame.update(Graphics g)
          Just calls paint(g).
 

Constructors in javax.swing with parameters of type Graphics
DebugGraphics(Graphics graphics)
          Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
DebugGraphics(Graphics graphics, JComponent component)
          Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component.
 

Uses of Graphics in javax.swing.border
 

Methods in javax.swing.border with parameters of type Graphics
 void SoftBevelBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 void EtchedBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 void BevelBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 void MatteBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the matte border.
 void EmptyBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Does no drawing by default.
 void CompoundBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the compound border by painting the outside border with the specified position and size and then painting the inside border at the specified position and size offset by the insets of the outside border.
 void TitledBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 void AbstractBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          This default implementation does no painting.
 void LineBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
 void Border.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          Paints the border for the specified component with the specified position and size.
protected  void BevelBorder.paintLoweredBevel(Component c, Graphics g, int x, int y, int width, int height)
           
protected  void BevelBorder.paintRaisedBevel(Component c, Graphics g, int x, int y, int width, int height)
           
 

Uses of Graphics in javax.swing.colorchooser
 

Methods in javax.swing.colorchooser with parameters of type Graphics
 void AbstractColorChooserPanel.paint(Graphics g)
          Draws the panel.
 

Uses of Graphics in javax.swing.plaf
 

Methods in javax.swing.plaf with parameters of type Graphics
abstract  void SplitPaneUI.finishedPaintingChildren(JSplitPane jc, Graphics g)
          Messaged after the JSplitPane the receiver is providing the look and feel for paints its children.
 void ComponentUI.paint(Graphics g, JComponent c)
          Paints the specified component appropriate for the look and feel.
 void BorderUIResource.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 void IconUIResource.paintIcon(Component c, Graphics g, int x, int y)
           
 void ComponentUI.update(Graphics g, JComponent c)
          Notifies this UI delegate that it's time to paint the specified component.
 

Uses of Graphics in javax.swing.plaf.basic
 

Methods in javax.swing.plaf.basic with parameters of type Graphics
static void BasicGraphicsUtils.drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
protected  void BasicTreeUI.drawCentered(Component c, Graphics graphics, Icon icon, int x, int y)
           
protected  void BasicTreeUI.drawDashedHorizontalLine(Graphics g, int y, int x1, int x2)
           
static void BasicGraphicsUtils.drawDashedRect(Graphics g, int x, int y, int width, int height)
           
protected  void BasicTreeUI.drawDashedVerticalLine(Graphics g, int x, int y1, int y2)
           
static void BasicGraphicsUtils.drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
static void BasicGraphicsUtils.drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
           
static void BasicGraphicsUtils.drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
           
static void BasicGraphicsUtils.drawString(Graphics g, String text, int underlinedChar, int x, int y)
          Draw a string with the graphics g at location (x,y) just like g.drawString would.
static void BasicGraphicsUtils.drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
          Draw a string with the graphics g at location (x, y) just like g.drawString would.
 void BasicSplitPaneUI.finishedPaintingChildren(JSplitPane jc, Graphics g)
          Messaged after the JSplitPane the receiver is providing the look and feel for paints its children.
protected  Point BasicProgressBarUI.getStringPlacement(Graphics g, String progressString, int x, int y, int width, int height)
          Designate the place where the progress string will be painted.
 void BasicToolBarUI.DragWindow.paint(Graphics g)
           
 void BasicInternalFrameTitlePane.SystemMenuBar.paint(Graphics g)
           
 void BasicArrowButton.paint(Graphics g)
           
 void BasicSplitPaneDivider.paint(Graphics g)
          Paints the divider.
 void BasicToolTipUI.paint(Graphics g, JComponent c)
           
 void BasicToolBarSeparatorUI.paint(Graphics g, JComponent c)
           
 void BasicTableUI.paint(Graphics g, JComponent c)
          Paint a representation of the table instance that was set in installUI().
 void BasicTableHeaderUI.paint(Graphics g, JComponent c)
           
 void BasicTabbedPaneUI.paint(Graphics g, JComponent c)
           
 void BasicSliderUI.paint(Graphics g, JComponent c)
           
 void BasicScrollPaneUI.paint(Graphics g, JComponent c)
           
 void BasicScrollBarUI.paint(Graphics g, JComponent c)
           
 void BasicProgressBarUI.paint(Graphics g, JComponent c)
          Delegates painting to one of two methods: paintDeterminate or paintIndeterminate.
 void BasicSeparatorUI.paint(Graphics g, JComponent c)
           
 void BasicPopupMenuSeparatorUI.paint(Graphics g, JComponent c)
           
 void BasicListUI.paint(Graphics g, JComponent c)
          Paint the rows that intersect the Graphics objects clipRect.
 void BasicDesktopPaneUI.paint(Graphics g, JComponent c)
           
 void BasicLabelUI.paint(Graphics g, JComponent c)
          Paint the label text in the foreground color, if the label is opaque then paint the entire background with the background color.
 void BasicToggleButtonUI.paint(Graphics g, JComponent c)
           
 void BasicRadioButtonUI.paint(Graphics g, JComponent c)
          paint the radio button
 void BasicButtonUI.paint(Graphics g, JComponent c)
           
 void BasicTextUI.paint(Graphics g, JComponent c)
          Paints the interface.
 void BasicComboBoxUI.paint(Graphics g, JComponent c)
           
 void BasicMenuItemUI.paint(Graphics g, JComponent c)
           
 void BasicTreeUI.paint(Graphics g, JComponent c)
           
 void BasicSplitPaneUI.paint(Graphics g, JComponent jc)
          Messaged to paint the look and feel.
protected  void BasicTextUI.paintBackground(Graphics g)
          Paints a background for the view.
protected  void BasicMenuItemUI.paintBackground(Graphics g, JMenuItem menuItem, Color bgColor)
          Draws the background of the menu item.
 void BasicBorders.RolloverButtonBorder.paintBorder(Component c, Graphics g, int x, int y, int w, int h)
           
 void BasicBorders.ButtonBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 void BasicBorders.ToggleButtonBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 void BasicBorders.RadioButtonBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 void BasicBorders.MenuBarBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 void BasicBorders.FieldBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
 void BasicBorders.SplitPaneBorder.paintBorder(Component c, Graphics g, int x, int y, int width, int height)
           
protected  void BasicButtonUI.paintButtonPressed(Graphics g, AbstractButton b)
           
protected  void BasicListUI.paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)
          Paint one List cell: compute the relevant state, get the "rubber stamp" cell renderer component, and then use the CellRendererPane to paint it.
 void BasicInternalFrameTitlePane.paintComponent(Graphics g)
           
protected  void BasicTabbedPaneUI.paintContentBorder(Graphics g, int tabPlacement, int selectedIndex)
           
protected  void BasicTabbedPaneUI.paintContentBorderBottomEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
           
protected  void BasicTabbedPaneUI.paintContentBorderLeftEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
           
protected  void BasicTabbedPaneUI.paintContentBorderRightEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
           
protected  void BasicTabbedPaneUI.paintContentBorderTopEdge(Graphics g, int tabPlacement, int selectedIndex, int x, int y, int w, int h)
           
 void BasicComboBoxUI.paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
          Paints the currently selected item.
 void BasicComboBoxUI.paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
          Paints the background of the currently selected item.
protected  void BasicScrollBarUI.paintDecreaseHighlight(Graphics g)
           
protected  void BasicProgressBarUI.paintDeterminate(Graphics g, JComponent c)
          All purpose paint method that should do the right thing for almost all linear, determinate progress bars.
protected  void BasicLabelUI.paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
          Paint clippedText at textX, textY with background.lighter() and then shifted down and to the right by one pixel with background.darker().
protected  void BasicToolBarUI.paintDragWindow(Graphics g)
          Paints the contents of the window used for dragging.
protected  void BasicLabelUI.paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
          Paint clippedText at textX, textY with the labels foreground color.
protected  void BasicTreeUI.paintExpandControl(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
          Paints the expand (toggle) part of a row.
 void BasicSliderUI.paintFocus(Graphics g)
           
protected  void BasicButtonUI.paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
           
protected  void BasicRadioButtonUI.paintFocus(Graphics g, Rectangle textRect, Dimension size)
           
protected  void BasicTabbedPaneUI.paintFocusIndicator(Graphics g, int tabPlacement, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect, boolean isSelected)
           
protected  void BasicSliderUI.paintHorizontalLabel(Graphics g, int value, Component label)
          Called for every label in the label table.
protected  void BasicTreeUI.paintHorizontalLine(Graphics g, JComponent c, int y, int left, int right)
          Paints a horizontal line.
protected  void BasicTreeUI.paintHorizontalPartOfLeg(Graphics g, Rectangle clipBounds, Insets insets, Rectangle bounds, TreePath path, int row, boolean isExpanded, boolean hasBeenExpanded, boolean isLeaf)
          Paints the horizontal part of the leg.
protected  void BasicToggleButtonUI.paintIcon(Graphics g, AbstractButton b, Rectangle iconRect)
           
protected  void BasicTabbedPaneUI.paintIcon(Graphics g, int tabPlacement, int tabIndex, Icon icon, Rectangle iconRect, boolean isSelected)
           
protected  void BasicButtonUI.paintIcon(Graphics g, JComponent c, Rectangle iconRect)
           
protected  void BasicScrollBarUI.paintIncreaseHighlight(Graphics g)
           
protected  void BasicProgressBarUI.paintIndeterminate(Graphics g, JComponent c)
          All purpose paint method that should do the right thing for all linear bouncing-box progress bars.
 void BasicSliderUI.paintLabels(Graphics g)
           
protected  void BasicSliderUI.paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)
           
protected  void BasicSliderUI.paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)
           
protected  void BasicMenuItemUI.paintMenuItem(Graphics g, JComponent c, Icon checkIcon, Icon arrowIcon, Color background, Color foreground, int defaultTextIconGap)