javax.swing
Class JComponent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Container sample code for java.awt.Container definition code for java.awt.Container 
          extended by javax.swing.JComponent
All Implemented Interfaces:
ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable
Direct Known Subclasses:
AbstractButton sample code for javax.swing.AbstractButton definition code for javax.swing.AbstractButton , BasicInternalFrameTitlePane sample code for javax.swing.plaf.basic.BasicInternalFrameTitlePane definition code for javax.swing.plaf.basic.BasicInternalFrameTitlePane , Box sample code for javax.swing.Box definition code for javax.swing.Box , Box.Filler sample code for javax.swing.Box.Filler definition code for javax.swing.Box.Filler , JColorChooser sample code for javax.swing.JColorChooser definition code for javax.swing.JColorChooser , JComboBox sample code for javax.swing.JComboBox definition code for javax.swing.JComboBox , JFileChooser sample code for javax.swing.JFileChooser definition code for javax.swing.JFileChooser , JInternalFrame sample code for javax.swing.JInternalFrame definition code for javax.swing.JInternalFrame , JInternalFrame.JDesktopIcon sample code for javax.swing.JInternalFrame.JDesktopIcon definition code for javax.swing.JInternalFrame.JDesktopIcon , JLabel sample code for javax.swing.JLabel definition code for javax.swing.JLabel , JLayeredPane sample code for javax.swing.JLayeredPane definition code for javax.swing.JLayeredPane , JList sample code for javax.swing.JList definition code for javax.swing.JList , JMenuBar sample code for javax.swing.JMenuBar definition code for javax.swing.JMenuBar , JOptionPane sample code for javax.swing.JOptionPane definition code for javax.swing.JOptionPane , JPanel sample code for javax.swing.JPanel definition code for javax.swing.JPanel , JPopupMenu sample code for javax.swing.JPopupMenu definition code for javax.swing.JPopupMenu , JProgressBar sample code for javax.swing.JProgressBar definition code for javax.swing.JProgressBar , JRootPane sample code for javax.swing.JRootPane definition code for javax.swing.JRootPane , JScrollBar sample code for javax.swing.JScrollBar definition code for javax.swing.JScrollBar , JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane , JSeparator sample code for javax.swing.JSeparator definition code for javax.swing.JSeparator , JSlider sample code for javax.swing.JSlider definition code for javax.swing.JSlider , JSpinner sample code for javax.swing.JSpinner definition code for javax.swing.JSpinner , JSplitPane sample code for javax.swing.JSplitPane definition code for javax.swing.JSplitPane , JTabbedPane sample code for javax.swing.JTabbedPane definition code for javax.swing.JTabbedPane , JTable sample code for javax.swing.JTable definition code for javax.swing.JTable , JTableHeader sample code for javax.swing.table.JTableHeader definition code for javax.swing.table.JTableHeader , JTextComponent sample code for javax.swing.text.JTextComponent definition code for javax.swing.text.JTextComponent , JToolBar sample code for javax.swing.JToolBar definition code for javax.swing.JToolBar , JToolTip sample code for javax.swing.JToolTip definition code for javax.swing.JToolTip , JTree sample code for javax.swing.JTree definition code for javax.swing.JTree , JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport

public abstract class JComponent
extends Container sample code for java.awt.Container definition code for java.awt.Container
implements Serializable sample code for java.io.Serializable definition code for java.io.Serializable

The base class for all Swing components except top-level containers. To use a component that inherits from JComponent, you must place the component in a containment hierarchy whose root is a top-level Swing container. Top-level Swing containers -- such as JFrame, JDialog, and JApplet -- are specialized components that provide a place for other Swing components to paint themselves. For an explanation of containment hierarchies, see Swing Components and the Containment Hierarchy, a section in The Java Tutorial.

The JComponent class provides:

For more information on these subjects, see the Swing package description and The Java Tutorial section The JComponent Class.

JComponent and its subclasses document default values for certain properties. For example, JTable documents the default row height as 16. Each JComponent subclass that has a ComponentUI will create the ComponentUI as part of its constructor. In order to provide a particular look and feel each ComponentUI may set properties back on the JComponent that created it. For example, a custom look and feel may require JTables to have a row height of 24. The documented defaults are the value of a property BEFORE the ComponentUI has been installed. If you need a specific value for a particular property you should explicitly set it.

In release 1.4, the focus subsystem was rearchitected. For more information, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke , Action sample code for javax.swing.Action definition code for javax.swing.Action , setBorder(javax.swing.border.Border) sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) , registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) , JOptionPane sample code for javax.swing.JOptionPane definition code for javax.swing.JOptionPane , setDebugGraphicsOptions(int) sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) , setToolTipText(java.lang.String) sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) , setAutoscrolls(boolean) sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) , Serialized Form

Nested Class Summary
 class JComponent.AccessibleJComponent sample code for javax.swing.JComponent.AccessibleJComponent definition code for javax.swing.JComponent.AccessibleJComponent
          Inner class of JComponent used to provide default support for accessibility.
 
Nested classes/interfaces inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
Container.AccessibleAWTContainer sample code for java.awt.Container.AccessibleAWTContainer definition code for java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext accessibleContext sample code for javax.swing.JComponent.accessibleContext definition code for javax.swing.JComponent.accessibleContext
          The AccessibleContext associated with this JComponent.
protected  EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList listenerList sample code for javax.swing.JComponent.listenerList definition code for javax.swing.JComponent.listenerList
          A list of event listeners for this component.
static String sample code for java.lang.String definition code for java.lang.String TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY
          The comment to display when the cursor is over the component, also known as a "value tip", "flyover help", or "flyover label".
protected  ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI ui sample code for javax.swing.JComponent.ui definition code for javax.swing.JComponent.ui
          The look and feel delegate for this component.
static int UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION definition code for javax.swing.JComponent.UNDEFINED_CONDITION
          Constant used by some of the APIs to mean that no condition is defined.
static int WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT definition code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
          Constant used for registerKeyboardAction that means that the command should be invoked when the receiving component is an ancestor of the focused component or is itself the focused component.
static int WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED definition code for javax.swing.JComponent.WHEN_FOCUSED
          Constant used for registerKeyboardAction that means that the command should be invoked when the component has the focus.
static int WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW definition code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW
          Constant used for registerKeyboardAction that means that the command should be invoked when the receiving component is in the window that has the focus or is itself the focused component.
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
JComponent sample code for javax.swing.JComponent.JComponent() definition code for javax.swing.JComponent.JComponent() ()
          Default JComponent constructor.
 
Method Summary
 void addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) (AncestorListener sample code for javax.swing.event.AncestorListener definition code for javax.swing.event.AncestorListener  listener)
          Registers listener so that it will receive AncestorEvents when it or any of its ancestors move or are made visible or invisible.
 void addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify() ()
          Notifies this component that it now has a parent component.
 void addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) (VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  listener)
          Adds a VetoableChangeListener to the listener list.
 void computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect)
          Returns the Component's "visible rect rectangle" - the intersection of the visible rectangles for this component and all of its ancestors.
 boolean contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int) (int x, int y)
          Gives the UI delegate an opportunity to define the precise shape of this component for the sake of mouse processing.
 JToolTip sample code for javax.swing.JToolTip definition code for javax.swing.JToolTip createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip() ()
          Returns the instance of JToolTip that should be used to display the tooltip.
 void disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable() ()
          Deprecated. As of JDK version 1.1, replaced by java.awt.Component.setEnabled(boolean).
 void enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable() ()
          Deprecated. As of JDK version 1.1, replaced by java.awt.Component.setEnabled(boolean).
 void firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) (String sample code for java.lang.String definition code for java.lang.String  propertyName, boolean oldValue, boolean newValue)
          Support for reporting bound property changes for boolean properties.
 void firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) (String sample code for java.lang.String definition code for java.lang.String  propertyName, char oldValue, char newValue)
          Reports a bound property change.
 void firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) (String sample code for java.lang.String definition code for java.lang.String  propertyName, int oldValue, int newValue)
          Support for reporting bound property changes for integer properties.
protected  void fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) (String sample code for java.lang.String definition code for java.lang.String  propertyName, Object sample code for java.lang.Object definition code for java.lang.Object  oldValue, Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
          Supports reporting constrained property changes.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for javax.swing.JComponent.getAccessibleContext() definition code for javax.swing.JComponent.getAccessibleContext() ()
          Returns the AccessibleContext associated with this JComponent.
 ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke)
          Returns the object that will perform the action registered for a given keystroke.
 ActionMap sample code for javax.swing.ActionMap definition code for javax.swing.ActionMap getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap() ()
          Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding.
 float getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX() ()
          Overrides Container.getAlignmentX to return the vertical alignment.
 float getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY() ()
          Overrides Container.getAlignmentY to return the horizontal alignment.
 AncestorListener sample code for javax.swing.event.AncestorListener definition code for javax.swing.event.AncestorListener [] getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners() ()
          Returns an array of all the ancestor listeners registered on this component.
 boolean getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() ()
          Gets the autoscrolls property.
 Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder() ()
          Returns the border of this component or null if no border is currently set.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  rv)
          Stores the bounds of this component into "return value" rv and returns rv.
 Object sample code for java.lang.Object definition code for java.lang.Object getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key)
          Returns the value of the property with the specified key.
protected  Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Returns the graphics object used to paint this component.
 JPopupMenu sample code for javax.swing.JPopupMenu definition code for javax.swing.JPopupMenu getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu() ()
          Returns JPopupMenu that assigned for this component.
 int getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke)
          Returns the condition that determines whether a registered action occurs in response to the specified keystroke.
 int getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions() ()
          Returns the state of graphics debugging.
static Locale sample code for java.util.Locale definition code for java.util.Locale getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() ()
          Returns the default locale used to initialize each JComponent's locale property upon creation.
 FontMetrics sample code for java.awt.FontMetrics definition code for java.awt.FontMetrics getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font) (Font sample code for java.awt.Font definition code for java.awt.Font  font)
          Gets the FontMetrics for the specified Font.
 Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics() ()
          Returns this component's graphics context, which lets you draw on a component.
 int getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight() ()
          Returns the current height of this component.
 boolean getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu() ()
          Returns true if the JPopupMenu should be inherited from the parent.
 InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap() ()
          Returns the InputMap that is used when the component has focus.
 InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int) (int condition)
          Returns the InputMap that is used during condition.
 InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() ()
          Returns the input verifier for this component.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets() ()
          If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets.
 Insets sample code for java.awt.Insets definition code for java.awt.Insets getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets) (Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
          Returns an Insets object containing this component's inset values.
<T extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener >
T[]
getListeners sample code for javax.swing.JComponent.getListeners(java.lang.Class) definition code for javax.swing.JComponent.getListeners(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <T> listenerType)
          Returns an array of all the objects currently registered as FooListeners upon this JComponent.
 Point sample code for java.awt.Point definition code for java.awt.Point getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.Point  rv)
          Stores the x,y origin of this component into "return value" rv and returns rv.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize() ()
          If the maximum size has been set to a non-null value just returns it.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize() ()
          If the minimum size has been set to a non-null value just returns it.
 Component sample code for java.awt.Component definition code for java.awt.Component getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() ()
          Deprecated. As of 1.4, replaced by FocusTraversalPolicy.
 Point sample code for java.awt.Point definition code for java.awt.Point getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
          Returns the preferred location to display the popup menu in this component's coordinate system.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize() ()
          If the preferredSize has been set to a non-null value just returns it.
 KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke [] getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes() ()
          Returns the KeyStrokes that will initiate registered actions.
 JRootPane sample code for javax.swing.JRootPane definition code for javax.swing.JRootPane getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane() ()
          Returns the JRootPane ancestor for this component.
 Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  rv)
          Stores the width/height of this component into "return value" rv and returns rv.
 Point sample code for java.awt.Point definition code for java.awt.Point getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
          Returns the tooltip location in this component's coordinate system.
 String sample code for java.lang.String definition code for java.lang.String getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText() ()
          Returns the tooltip string that has been set with setToolTipText.
 String sample code for java.lang.String definition code for java.lang.String getToolTipText sample code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
          Returns the string to be used as the tooltip for event.
 Container sample code for java.awt.Container definition code for java.awt.Container getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor() ()
          Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container.
 TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler() ()
          Gets the transferHandler property.
 String sample code for java.lang.String definition code for java.lang.String getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID() ()
          Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component.
 boolean getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() ()
          Returns the value that indicates whether the input verifier for the current focus owner will be called before this component requests focus.
 VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener [] getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() ()
          Returns an array of all the vetoable change listeners registered on this component.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect() ()
          Returns the Component's "visible rectangle" - the intersection of this component's visible rectangle, new Rectangle(0, 0, getWidth(), getHeight()), and all of its ancestors' visible rectangles.
 int getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth() ()
          Returns the current width of this component.
 int getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX() ()
          Returns the current x coordinate of the component's origin.
 int getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY() ()
          Returns the current y coordinate of the component's origin.
 void grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus() ()
          Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.
 boolean isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered() ()
          Returns whether this component should use a buffer to paint.
static boolean isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  c)
          Returns true if this component is lightweight, that is, if it doesn't have a native window system peer.
 boolean isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus() ()
          Deprecated. As of 1.4, replaced by Component.setFocusTraversalKeys(int, Set) and Container.setFocusCycleRoot(boolean).
 boolean isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque() ()
          Returns true if this component is completely opaque.
 boolean isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled() ()
          Returns true if this component tiles its children -- that is, if it can guarantee that the children will not overlap.
 boolean isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile() ()
          Returns true if the component is currently painting a tile.
 boolean isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled() ()
          Returns true if this JComponent should get focus; otherwise returns false.
 boolean isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() ()
          If this method returns true, revalidate calls by descendants of this component will cause the entire tree beginning with this root to be validated.
 void paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Invoked by Swing to draw components.
protected  void paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Paints the component's border.
protected  void paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Paints this component's children.
protected  void paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Calls the UI delegate's paint method, if the UI delegate is non-null.
 void paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int) (int x, int y, int w, int h)
          Paints the specified region in this component and all of its descendants that overlap the region, immediately.
 void paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
          Paints the specified region now.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for javax.swing.JComponent.paramString() definition code for javax.swing.JComponent.paramString() ()
          Returns a string representation of this JComponent.
 void print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Invoke this method to print the component.
 void printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Invoke this method to print the component.
protected  void printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Prints the component's border.
protected  void printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Prints this component's children.
protected  void printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          This is invoked during a printing operation.
protected  void processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) (KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e)
          Processes any key events that the component itself recognizes.
protected  boolean processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  ks, KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e, int condition, boolean pressed)
          Invoked to process the key bindings for ks as the result of the KeyEvent e.
protected  void processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) (KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e)
          Overrides processKeyEvent to process events.
protected  void processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects, refer to Component.processMouseEvent(MouseEvent) sample code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) for a complete description of this method.
protected  void processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Processes mouse motion events, such as MouseEvent.MOUSE_DRAGGED.
 void putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  key, Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Adds an arbitrary key/value "client property" to this component.
 void registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) (ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  anAction, KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke, int aCondition)
          This method is now obsolete, please use a combination of getActionMap() and getInputMap() for similiar behavior.
 void registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) (ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  anAction, String sample code for java.lang.String definition code for java.lang.String  aCommand, KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke, int aCondition)
          This method is now obsolete, please use a combination of getActionMap() and getInputMap() for similiar behavior.
 void removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) (AncestorListener sample code for javax.swing.event.AncestorListener definition code for javax.swing.event.AncestorListener  listener)
          Unregisters listener so that it will no longer receive AncestorEvents.
 void removeNotify sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify() ()
          Notifies this component that it no longer has a parent component.
 void removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) (VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  listener)
          Removes a VetoableChangeListener from the listener list.
 void repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int) (long tm, int x, int y, int width, int height)
          Adds the specified region to the dirty region list if the component is showing.
 void repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
          Adds the specified region to the dirty region list if the component is showing.
 boolean requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus() ()
          Deprecated. As of 1.4, replaced by FocusTraversalPolicy.getDefaultComponent(Container).requestFocus()
 void requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus() ()
          Requests that this Component gets the input focus.
 boolean requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean) (boolean temporary)
          Requests that this Component gets the input focus.
 boolean requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() ()
          Requests that this Component gets the input focus.
protected  boolean requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) (boolean temporary)
          Requests that this Component gets the input focus.
 void resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions() ()
          Unregisters all the bindings in the first tier InputMaps and ActionMap.
 void reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int) (int x, int y, int w, int h)
          Deprecated. As of JDK 5, replaced by Component.setBounds(int, int, int, int).

Moves and resizes this component.

 void revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() ()
          Supports deferred automatic layout.
 void scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  aRect)
          Forwards the scrollRectToVisible() message to the JComponent's parent.
 void setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) (ActionMap sample code for javax.swing.ActionMap definition code for javax.swing.ActionMap  am)
          Sets the ActionMap to am.
 void setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) (float alignmentX)
          Sets the the vertical alignment.
 void setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) (float alignmentY)
          Sets the the horizontal alignment.
 void setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean) (boolean autoscrolls)
          Sets the autoscrolls property.
 void setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  bg)
          Sets the background color of this component.
 void setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border) (Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border  border)
          Sets the border of this component.
 void setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) (JPopupMenu sample code for javax.swing.JPopupMenu definition code for javax.swing.JPopupMenu  popup)
          Sets the JPopupMenu for this JComponent.
 void setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int) (int debugOptions)
          Enables or disables diagnostic information about every graphics operation performed within the component or one of its children.
static void setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) (Locale sample code for java.util.Locale definition code for java.util.Locale  l)
          Sets the default locale used to initialize each JComponent's locale property upon creation.
 void setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean) (boolean aFlag)
          Sets whether the this component should use a buffer to paint.
 void setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean) (boolean enabled)
          Sets whether or not this component is enabled.
 void setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set) (int id, Set sample code for java.util.Set definition code for java.util.Set <? extends AWTKeyStroke sample code for java.awt.AWTKeyStroke definition code for java.awt.AWTKeyStroke > keystrokes)
          Sets the focus traversal keys for a given traversal operation for this Component.
 void setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font) (Font sample code for java.awt.Font definition code for java.awt.Font  font)
          Sets the font for this component.
 void setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color) (Color sample code for java.awt.Color definition code for java.awt.Color  fg)
          Sets the foreground color of this component.
 void setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean) (boolean value)
          Sets whether or not getComponentPopupMenu should delegate to the parent if this component does not have a JPopupMenu assigned to it.
 void setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) (int condition, InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap  map)
          Sets the InputMap to use under the condition condition to map.
 void setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) (InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier  inputVerifier)
          Sets the input verifier for this component.
 void setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  maximumSize)
          Sets the maximum size of this component to a constant value.
 void setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  minimumSize)
          Sets the minimum size of this component to a constant value.
 void setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) (Component sample code for java.awt.Component definition code for java.awt.Component  aComponent)
          Deprecated. As of 1.4, replaced by FocusTraversalPolicy
 void setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean) (boolean isOpaque)
          If true the component paints every pixel within its bounds.
 void setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) (Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  preferredSize)
          Sets the preferred size of this component.
 void setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) (boolean requestFocusEnabled)
          Provides a hint as to whether or not this JComponent should get focus.
 void setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  text)
          Registers the text to display in a tool tip.
 void setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) (TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler  newHandler)
          Sets the transferHandler property, which is null if the component does not support data transfer operations.
protected  void setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) (ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI  newUI)
          Sets the look and feel delegate for this component.
 void setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) (boolean verifyInputWhenFocusTarget)
          Sets the value to indicate whether input verifier for the current focus owner will be called before this component requests focus.
 void setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean) (boolean aFlag)
          Makes the component visible or invisible.
 void unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) (KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke)
          This method is now obsolete.
 void update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics) (Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
          Calls paint.
 void updateUI sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI() ()
          Resets the UI property to a value from the current look and feel.
 
Methods inherited from class java.awt.Container sample code for java.awt.Container definition code for java.awt.Container
add sample code for java.awt.Container.add(java.awt.Component) definition code for java.awt.Container.add(java.awt.Component) , add sample code for java.awt.Container.add(java.awt.Component, int) definition code for java.awt.Container.add(java.awt.Component, int) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object) , add sample code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.add(java.awt.Component, java.lang.Object, int) , add sample code for java.awt.Container.add(java.lang.String, java.awt.Component) definition code for java.awt.Container.add(java.lang.String, java.awt.Component) , addContainerListener sample code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.addContainerListener(java.awt.event.ContainerListener) , addImpl sample code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) definition code for java.awt.Container.addImpl(java.awt.Component, java.lang.Object, int) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Container.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Container.areFocusTraversalKeysSet(int) definition code for java.awt.Container.areFocusTraversalKeysSet(int) , countComponents sample code for java.awt.Container.countComponents() definition code for java.awt.Container.countComponents() , deliverEvent sample code for java.awt.Container.deliverEvent(java.awt.Event) definition code for java.awt.Container.deliverEvent(java.awt.Event) , doLayout sample code for java.awt.Container.doLayout() definition code for java.awt.Container.doLayout() , findComponentAt sample code for java.awt.Container.findComponentAt(int, int) definition code for java.awt.Container.findComponentAt(int, int) , findComponentAt sample code for java.awt.Container.findComponentAt(java.awt.Point) definition code for java.awt.Container.findComponentAt(java.awt.Point) , getComponent sample code for java.awt.Container.getComponent(int) definition code for java.awt.Container.getComponent(int) , getComponentAt sample code for java.awt.Container.getComponentAt(int, int) definition code for java.awt.Container.getComponentAt(int, int) , getComponentAt sample code for java.awt.Container.getComponentAt(java.awt.Point) definition code for java.awt.Container.getComponentAt(java.awt.Point) , getComponentCount sample code for java.awt.Container.getComponentCount() definition code for java.awt.Container.getComponentCount() , getComponents sample code for java.awt.Container.getComponents() definition code for java.awt.Container.getComponents() , getComponentZOrder sample code for java.awt.Container.getComponentZOrder(java.awt.Component) definition code for java.awt.Container.getComponentZOrder(java.awt.Component) , getContainerListeners sample code for java.awt.Container.getContainerListeners() definition code for java.awt.Container.getContainerListeners() , getFocusTraversalKeys sample code for java.awt.Container.getFocusTraversalKeys(int) definition code for java.awt.Container.getFocusTraversalKeys(int) , getFocusTraversalPolicy sample code for java.awt.Container.getFocusTraversalPolicy() definition code for java.awt.Container.getFocusTraversalPolicy() , getLayout sample code for java.awt.Container.getLayout() definition code for java.awt.Container.getLayout() , getMousePosition sample code for java.awt.Container.getMousePosition(boolean) definition code for java.awt.Container.getMousePosition(boolean) , insets sample code for java.awt.Container.insets() definition code for java.awt.Container.insets() , invalidate sample code for java.awt.Container.invalidate() definition code for java.awt.Container.invalidate() , isAncestorOf sample code for java.awt.Container.isAncestorOf(java.awt.Component) definition code for java.awt.Container.isAncestorOf(java.awt.Component) , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot() definition code for java.awt.Container.isFocusCycleRoot() , isFocusCycleRoot sample code for java.awt.Container.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Container.isFocusCycleRoot(java.awt.Container) , isFocusTraversalPolicyProvider sample code for java.awt.Container.isFocusTraversalPolicyProvider() definition code for java.awt.Container.isFocusTraversalPolicyProvider() , isFocusTraversalPolicySet sample code for java.awt.Container.isFocusTraversalPolicySet() definition code for java.awt.Container.isFocusTraversalPolicySet() , layout sample code for java.awt.Container.layout() definition code for java.awt.Container.layout() , list sample code for java.awt.Container.list(java.io.PrintStream, int) definition code for java.awt.Container.list(java.io.PrintStream, int) , list sample code for java.awt.Container.list(java.io.PrintWriter, int) definition code for java.awt.Container.list(java.io.PrintWriter, int) , locate sample code for java.awt.Container.locate(int, int) definition code for java.awt.Container.locate(int, int) , minimumSize sample code for java.awt.Container.minimumSize() definition code for java.awt.Container.minimumSize() , paintComponents sample code for java.awt.Container.paintComponents(java.awt.Graphics) definition code for java.awt.Container.paintComponents(java.awt.Graphics) , preferredSize sample code for java.awt.Container.preferredSize() definition code for java.awt.Container.preferredSize() , printComponents sample code for java.awt.Container.printComponents(java.awt.Graphics) definition code for java.awt.Container.printComponents(java.awt.Graphics) , processContainerEvent sample code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) definition code for java.awt.Container.processContainerEvent(java.awt.event.ContainerEvent) , processEvent sample code for java.awt.Container.processEvent(java.awt.AWTEvent) definition code for java.awt.Container.processEvent(java.awt.AWTEvent) , remove sample code for java.awt.Container.remove(java.awt.Component) definition code for java.awt.Container.remove(java.awt.Component) , remove sample code for java.awt.Container.remove(int) definition code for java.awt.Container.remove(int) , removeAll sample code for java.awt.Container.removeAll() definition code for java.awt.Container.removeAll() , removeContainerListener sample code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) definition code for java.awt.Container.removeContainerListener(java.awt.event.ContainerListener) , setComponentZOrder sample code for java.awt.Container.setComponentZOrder(java.awt.Component, int) definition code for java.awt.Container.setComponentZOrder(java.awt.Component, int) , setFocusCycleRoot sample code for java.awt.Container.setFocusCycleRoot(boolean) definition code for java.awt.Container.setFocusCycleRoot(boolean) , setFocusTraversalPolicy sample code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) definition code for java.awt.Container.setFocusTraversalPolicy(java.awt.FocusTraversalPolicy) , setFocusTraversalPolicyProvider sample code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) definition code for java.awt.Container.setFocusTraversalPolicyProvider(boolean) , setLayout sample code for java.awt.Container.setLayout(java.awt.LayoutManager) definition code for java.awt.Container.setLayout(java.awt.LayoutManager) , transferFocusBackward sample code for java.awt.Container.transferFocusBackward() definition code for java.awt.Container.transferFocusBackward() , transferFocusDownCycle sample code for java.awt.Container.transferFocusDownCycle() definition code for java.awt.Container.transferFocusDownCycle() , validate sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , validateTree sample code for java.awt.Container.validateTree() definition code for java.awt.Container.validateTree()
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addInputMethodListener sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getInputMethodRequests sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processInputMethodEvent sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setComponentOrientation sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

ui sample code for javax.swing.JComponent.ui

protected transient ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI  ui
The look and feel delegate for this component.


listenerList sample code for javax.swing.JComponent.listenerList

protected EventListenerList sample code for javax.swing.event.EventListenerList definition code for javax.swing.event.EventListenerList  listenerList
A list of event listeners for this component.


WHEN_FOCUSED sample code for javax.swing.JComponent.WHEN_FOCUSED

public static final int WHEN_FOCUSED
Constant used for registerKeyboardAction that means that the command should be invoked when the component has the focus.

See Also:
Constant Field Values

WHEN_ANCESTOR_OF_FOCUSED_COMPONENT sample code for javax.swing.JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT

public static final int WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Constant used for registerKeyboardAction that means that the command should be invoked when the receiving component is an ancestor of the focused component or is itself the focused component.

See Also:
Constant Field Values

WHEN_IN_FOCUSED_WINDOW sample code for javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW

public static final int WHEN_IN_FOCUSED_WINDOW
Constant used for registerKeyboardAction that means that the command should be invoked when the receiving component is in the window that has the focus or is itself the focused component.

See Also:
Constant Field Values

UNDEFINED_CONDITION sample code for javax.swing.JComponent.UNDEFINED_CONDITION

public static final int UNDEFINED_CONDITION
Constant used by some of the APIs to mean that no condition is defined.

See Also:
Constant Field Values

TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY

public static final String sample code for java.lang.String definition code for java.lang.String  TOOL_TIP_TEXT_KEY
The comment to display when the cursor is over the component, also known as a "value tip", "flyover help", or "flyover label".

See Also:
Constant Field Values

accessibleContext sample code for javax.swing.JComponent.accessibleContext

protected AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  accessibleContext
The AccessibleContext associated with this JComponent.

Constructor Detail

JComponent sample code for javax.swing.JComponent() definition code for javax.swing.JComponent()

public JComponent()
Default JComponent constructor. This constructor does very little initialization beyond calling the Container constructor. For example, the initial layout manager is null. It does, however, set the component's locale property to the value returned by JComponent.getDefaultLocale.

See Also:
getDefaultLocale() sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale()
Method Detail

setInheritsPopupMenu sample code for javax.swing.JComponent.setInheritsPopupMenu(boolean) definition code for javax.swing.JComponent.setInheritsPopupMenu(boolean)

public void setInheritsPopupMenu(boolean value)
Sets whether or not getComponentPopupMenu should delegate to the parent if this component does not have a JPopupMenu assigned to it.

The default value for this is false, but some JComponent subclasses that are implemented as a number of JComponents may set this to true.

This is a bound property.

Parameters:
value - whether or not the JPopupMenu is inherited
Since:
1.5
See Also:
setComponentPopupMenu(javax.swing.JPopupMenu) sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu)

getInheritsPopupMenu sample code for javax.swing.JComponent.getInheritsPopupMenu() definition code for javax.swing.JComponent.getInheritsPopupMenu()

public boolean getInheritsPopupMenu()
Returns true if the JPopupMenu should be inherited from the parent.

Since:
1.5
See Also:
setComponentPopupMenu(javax.swing.JPopupMenu) sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu)

setComponentPopupMenu sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu)

public void setComponentPopupMenu(JPopupMenu sample code for javax.swing.JPopupMenu definition code for javax.swing.JPopupMenu  popup)
Sets the JPopupMenu for this JComponent. The UI is responsible for registering bindings and adding the necessary listeners such that the JPopupMenu will be shown at the appropriate time. When the JPopupMenu is shown depends upon the look and feel: some may show it on a mouse event, some may enable a key binding.

If popup is null, and getInheritsPopupMenu returns true, then getComponentPopupMenu will be delegated to the parent. This provides for a way to make all child components inherit the popupmenu of the parent.

This is a bound property.

Parameters:
popup - - the popup that will be assigned to this component may be null
Since:
1.5
See Also:
getComponentPopupMenu() sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu()

getComponentPopupMenu sample code for javax.swing.JComponent.getComponentPopupMenu() definition code for javax.swing.JComponent.getComponentPopupMenu()

public JPopupMenu sample code for javax.swing.JPopupMenu definition code for javax.swing.JPopupMenu  getComponentPopupMenu()
Returns JPopupMenu that assigned for this component. If this component does not have a JPopupMenu assigned to it and getInheritsPopupMenu is true, this will return getParent().getComponentPopupMenu() (assuming the parent is valid.)

Returns:
JPopupMenu assigned for this component or null if no popup assigned
Since:
1.5
See Also:
setComponentPopupMenu(javax.swing.JPopupMenu) sample code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu) definition code for javax.swing.JComponent.setComponentPopupMenu(javax.swing.JPopupMenu)

updateUI sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI()

public void updateUI()
Resets the UI property to a value from the current look and feel. JComponent subclasses must override this method like this:
   public void updateUI() {
      setUI((SliderUI)UIManager.getUI(this);
   }
  

See Also:
setUI(javax.swing.plaf.ComponentUI) sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) , UIManager.getLookAndFeel() sample code for javax.swing.UIManager.getLookAndFeel() definition code for javax.swing.UIManager.getLookAndFeel() , UIManager.getUI(javax.swing.JComponent) sample code for javax.swing.UIManager.getUI(javax.swing.JComponent) definition code for javax.swing.UIManager.getUI(javax.swing.JComponent)

setUI sample code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI) definition code for javax.swing.JComponent.setUI(javax.swing.plaf.ComponentUI)

protected void setUI(ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI  newUI)
Sets the look and feel delegate for this component. JComponent subclasses generally override this method to narrow the argument type. For example, in JSlider:
 public void setUI(SliderUI newUI) {
     super.setUI(newUI);
 }
  

Additionally JComponent subclasses must provide a getUI method that returns the correct type. For example:

 public SliderUI getUI() {
     return (SliderUI)ui;
 }
 

Parameters:
newUI - the new UI delegate
See Also:
updateUI() sample code for javax.swing.JComponent.updateUI() definition code for javax.swing.JComponent.updateUI() , UIManager.getLookAndFeel() sample code for javax.swing.UIManager.getLookAndFeel() definition code for javax.swing.UIManager.getLookAndFeel() , UIManager.getUI(javax.swing.JComponent) sample code for javax.swing.UIManager.getUI(javax.swing.JComponent) definition code for javax.swing.UIManager.getUI(javax.swing.JComponent)

getUIClassID sample code for javax.swing.JComponent.getUIClassID() definition code for javax.swing.JComponent.getUIClassID()

public String sample code for java.lang.String definition code for java.lang.String  getUIClassID()
Returns the UIDefaults key used to look up the name of the swing.plaf.ComponentUI class that defines the look and feel for this component. Most applications will never need to call this method. Subclasses of JComponent that support pluggable look and feel should override this method to return a UIDefaults key that maps to the ComponentUI subclass that defines their look and feel.

Returns:
the UIDefaults key for a ComponentUI subclass
See Also:
UIDefaults.getUI(javax.swing.JComponent) sample code for javax.swing.UIDefaults.getUI(javax.swing.JComponent) definition code for javax.swing.UIDefaults.getUI(javax.swing.JComponent)

getComponentGraphics sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics)

protected Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  getComponentGraphics(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Returns the graphics object used to paint this component. If DebugGraphics is turned on we create a new DebugGraphics object if necessary. Otherwise we just configure the specified graphics object's foreground and font.

Parameters:
g - the original Graphics object
Returns:
a Graphics object configured for this component

paintComponent sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics)

protected void paintComponent(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoker super's implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in a non-opaque color. If you do not honor the opaque property you will likely see visual artifacts.

The passed in Graphics object might have a transform other than the identify transform installed on it. In this case, you might get unexpected results if you cumulatively apply another transform.

Parameters:
g - the Graphics object to protect
See Also:
paint(java.awt.Graphics) sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

paintChildren sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics)

protected void paintChildren(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Paints this component's children. If shouldUseBuffer is true, no component ancestor has a buffer and the component children can use a buffer if they have one. Otherwise, one ancestor has a buffer currently in use and children should not use a buffer to paint.

Parameters:
g - the Graphics context in which to paint
See Also:
paint(java.awt.Graphics) sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , Container.paint(java.awt.Graphics) sample code for java.awt.Container.paint(java.awt.Graphics) definition code for java.awt.Container.paint(java.awt.Graphics)

paintBorder sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics)

protected void paintBorder(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Paints the component's border.

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it.

Parameters:
g - the Graphics context in which to paint
See Also:
paint(java.awt.Graphics) sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , setBorder(javax.swing.border.Border) sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border)

update sample code for javax.swing.JComponent.update(java.awt.Graphics) definition code for javax.swing.JComponent.update(java.awt.Graphics)

public void update(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Calls paint. Doesn't clear the background but see ComponentUI.update, which is called by paintComponent.

Overrides:
update sample code for java.awt.Container.update(java.awt.Graphics) definition code for java.awt.Container.update(java.awt.Graphics) in class Container sample code for java.awt.Container definition code for java.awt.Container
Parameters:
g - the Graphics context in which to paint
See Also:
paint(java.awt.Graphics) sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics) , paintComponent(java.awt.Graphics) sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

paint sample code for javax.swing.JComponent.paint(java.awt.Graphics) definition code for javax.swing.JComponent.paint(java.awt.Graphics)

public void paint(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Invoked by Swing to draw components. Applications should not invoke paint directly, but should instead use the repaint method to schedule the component for redrawing.

This method actually delegates the work of painting to three protected methods: paintComponent, paintBorder, and paintChildren. They're called in the order listed to ensure that children appear on top of component itself. Generally speaking, the component and its children should not paint in the insets area allocated to the border. Subclasses can just override this method, as always. A subclass that just wants to specialize the UI (look and feel) delegate's paint method should just override paintComponent.

Overrides:
paint sample code for java.awt.Container.paint(java.awt.Graphics) definition code for java.awt.Container.paint(java.awt.Graphics) in class Container sample code for java.awt.Container definition code for java.awt.Container
Parameters:
g - the Graphics context in which to paint
See Also:
paintComponent(java.awt.Graphics) sample code for javax.swing.JComponent.paintComponent(java.awt.Graphics) definition code for javax.swing.JComponent.paintComponent(java.awt.Graphics) , paintBorder(java.awt.Graphics) sample code for javax.swing.JComponent.paintBorder(java.awt.Graphics) definition code for javax.swing.JComponent.paintBorder(java.awt.Graphics) , paintChildren(java.awt.Graphics) sample code for javax.swing.JComponent.paintChildren(java.awt.Graphics) definition code for javax.swing.JComponent.paintChildren(java.awt.Graphics) , getComponentGraphics(java.awt.Graphics) sample code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) definition code for javax.swing.JComponent.getComponentGraphics(java.awt.Graphics) , repaint(long, int, int, int, int) sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int)

printAll sample code for javax.swing.JComponent.printAll(java.awt.Graphics) definition code for javax.swing.JComponent.printAll(java.awt.Graphics)

public void printAll(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Invoke this method to print the component. This method invokes print on the component.

Overrides:
printAll sample code for java.awt.Component.printAll(java.awt.Graphics) definition code for java.awt.Component.printAll(java.awt.Graphics) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
g - the Graphics context in which to paint
See Also:
print(java.awt.Graphics) sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics) , printComponent(java.awt.Graphics) sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , printBorder(java.awt.Graphics) sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren(java.awt.Graphics) sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics)

print sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics)

public void print(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Invoke this method to print the component. This method will result in invocations to printComponent, printBorder and printChildren. It is not recommended that you override this method, instead override one of the previously mentioned methods. This method sets the component's state such that the double buffer will not be used, eg painting will be done directly on the passed in Graphics.

Overrides:
print sample code for java.awt.Container.print(java.awt.Graphics) definition code for java.awt.Container.print(java.awt.Graphics) in class Container sample code for java.awt.Container definition code for java.awt.Container
Parameters:
g - the Graphics context in which to paint
See Also:
printComponent(java.awt.Graphics) sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics) , printBorder(java.awt.Graphics) sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics) , printChildren(java.awt.Graphics) sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics)

printComponent sample code for javax.swing.JComponent.printComponent(java.awt.Graphics) definition code for javax.swing.JComponent.printComponent(java.awt.Graphics)

protected void printComponent(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
This is invoked during a printing operation. This is implemented to invoke paintComponent on the component. Override this if you wish to add special painting behavior when printing.

Parameters:
g - the Graphics context in which to paint
Since:
1.3
See Also:
print(java.awt.Graphics) sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics)

printChildren sample code for javax.swing.JComponent.printChildren(java.awt.Graphics) definition code for javax.swing.JComponent.printChildren(java.awt.Graphics)

protected void printChildren(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Prints this component's children. This is implemented to invoke paintChildren on the component. Override this if you wish to print the children differently than painting.

Parameters:
g - the Graphics context in which to paint
Since:
1.3
See Also:
print(java.awt.Graphics) sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics)

printBorder sample code for javax.swing.JComponent.printBorder(java.awt.Graphics) definition code for javax.swing.JComponent.printBorder(java.awt.Graphics)

protected void printBorder(Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  g)
Prints the component's border. This is implemented to invoke paintBorder on the component. Override this if you wish to print the border differently that it is painted.

Parameters:
g - the Graphics context in which to paint
Since:
1.3
See Also:
print(java.awt.Graphics) sample code for javax.swing.JComponent.print(java.awt.Graphics) definition code for javax.swing.JComponent.print(java.awt.Graphics)

isPaintingTile sample code for javax.swing.JComponent.isPaintingTile() definition code for javax.swing.JComponent.isPaintingTile()

public boolean isPaintingTile()
Returns true if the component is currently painting a tile. If this method returns true, paint will be called again for another tile. This method returns false if you are not painting a tile or if the last tile is painted. Use this method to keep some state you might need between tiles.

Returns:
true if the component is currently painting a tile, false otherwise

isManagingFocus sample code for javax.swing.JComponent.isManagingFocus() definition code for javax.swing.JComponent.isManagingFocus()

@Deprecated
public boolean isManagingFocus()
Deprecated. As of 1.4, replaced by Component.setFocusTraversalKeys(int, Set) and Container.setFocusCycleRoot(boolean).

In release 1.4, the focus subsystem was rearchitected. For more information, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Changes this JComponent's focus traversal keys to CTRL+TAB and CTRL+SHIFT+TAB. Also prevents SortingFocusTraversalPolicy from considering descendants of this JComponent when computing a focus traversal cycle.

See Also:
Component.setFocusTraversalKeys(int, java.util.Set) sample code for java.awt.Component.setFocusTraversalKeys(int, java.util.Set) definition code for java.awt.Component.setFocusTraversalKeys(int, java.util.Set) , SortingFocusTraversalPolicy sample code for javax.swing.SortingFocusTraversalPolicy definition code for javax.swing.SortingFocusTraversalPolicy

setNextFocusableComponent sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component)

@Deprecated
public void setNextFocusableComponent(Component sample code for java.awt.Component definition code for java.awt.Component  aComponent)
Deprecated. As of 1.4, replaced by FocusTraversalPolicy

In release 1.4, the focus subsystem was rearchitected. For more information, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Overrides the default FocusTraversalPolicy for this JComponent's focus traversal cycle by unconditionally setting the specified Component as the next Component in the cycle, and this JComponent as the specified Component's previous Component in the cycle.

Parameters:
aComponent - the Component that should follow this JComponent in the focus traversal cycle
See Also:
getNextFocusableComponent() sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent() , FocusTraversalPolicy sample code for java.awt.FocusTraversalPolicy definition code for java.awt.FocusTraversalPolicy

getNextFocusableComponent sample code for javax.swing.JComponent.getNextFocusableComponent() definition code for javax.swing.JComponent.getNextFocusableComponent()

@Deprecated
public Component sample code for java.awt.Component definition code for java.awt.Component  getNextFocusableComponent()
Deprecated. As of 1.4, replaced by FocusTraversalPolicy.

In release 1.4, the focus subsystem was rearchitected. For more information, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Returns the Component set by a prior call to setNextFocusableComponent(Component) on this JComponent.

Returns:
the Component that will follow this JComponent in the focus traversal cycle, or null if none has been explicitly specified
See Also:
setNextFocusableComponent(java.awt.Component) sample code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component) definition code for javax.swing.JComponent.setNextFocusableComponent(java.awt.Component)

setRequestFocusEnabled sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean)

public void setRequestFocusEnabled(boolean requestFocusEnabled)
Provides a hint as to whether or not this JComponent should get focus. This is only a hint, and it is up to consumers that are requesting focus to honor this property. This is typically honored for mouse operations, but not keyboard operations. For example, look and feels could verify this property is true before requesting focus during a mouse operation. This would often times be used if you did not want a mouse press on a JComponent to steal focus, but did want the JComponent to be traversable via the keyboard. If you do not want this JComponent focusable at all, use the setFocusable method instead.

Please see How to Use the Focus Subsystem, a section in The Java Tutorial, for more information.

Parameters:
requestFocusEnabled - indicates whether you want this JComponent to be focusable or not
See Also:
Focus Specification, Component.setFocusable(boolean) sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean)

isRequestFocusEnabled sample code for javax.swing.JComponent.isRequestFocusEnabled() definition code for javax.swing.JComponent.isRequestFocusEnabled()

public boolean isRequestFocusEnabled()
Returns true if this JComponent should get focus; otherwise returns false.

Please see How to Use the Focus Subsystem, a section in The Java Tutorial, for more information.

Returns:
true if this component should get focus, otherwise returns false
See Also:
setRequestFocusEnabled(boolean) sample code for javax.swing.JComponent.setRequestFocusEnabled(boolean) definition code for javax.swing.JComponent.setRequestFocusEnabled(boolean) , Focus Specification, Component.isFocusable() sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable()

requestFocus sample code for javax.swing.JComponent.requestFocus() definition code for javax.swing.JComponent.requestFocus()

public void requestFocus()
Requests that this Component gets the input focus. Refer to Component.requestFocus() sample code for java.awt.Component.requestFocus() definition code for java.awt.Component.requestFocus() for a complete description of this method.

Note that the use of this method is discouraged because its behavior is platform dependent. Instead we recommend the use of requestFocusInWindow() sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow() . If you would like more information on focus, see

Overrides:
requestFocus sample code for java.awt.Component.requestFocus() definition code for java.awt.Component.requestFocus() in class Component sample code for java.awt.Component definition code for java.awt.Component
Since:
1.4
See Also:
Component.requestFocusInWindow() sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() , Component.requestFocusInWindow(boolean) sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean)

requestFocus sample code for javax.swing.JComponent.requestFocus(boolean) definition code for javax.swing.JComponent.requestFocus(boolean)

public boolean requestFocus(boolean temporary)
Requests that this Component gets the input focus. Refer to Component.requestFocus(boolean) sample code for java.awt.Component.requestFocus(boolean) definition code for java.awt.Component.requestFocus(boolean) for a complete description of this method.

Note that the use of this method is discouraged because its behavior is platform dependent. Instead we recommend the use of requestFocusInWindow(boolean) sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean) . If you would like more information on focus, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Overrides:
requestFocus sample code for java.awt.Component.requestFocus(boolean) definition code for java.awt.Component.requestFocus(boolean) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
temporary - boolean indicating if the focus change is temporary
Returns:
false if the focus change request is guaranteed to fail; true if it is likely to succeed
Since:
1.4
See Also:
Component.requestFocusInWindow() sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() , Component.requestFocusInWindow(boolean) sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean)

requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow()

public boolean requestFocusInWindow()
Requests that this Component gets the input focus. Refer to Component.requestFocusInWindow() sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() for a complete description of this method.

If you would like more information on focus, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Overrides:
requestFocusInWindow sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
false if the focus change request is guaranteed to fail; true if it is likely to succeed
Since:
1.4
See Also:
Component.requestFocusInWindow() sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() , Component.requestFocusInWindow(boolean) sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean)

requestFocusInWindow sample code for javax.swing.JComponent.requestFocusInWindow(boolean) definition code for javax.swing.JComponent.requestFocusInWindow(boolean)

protected boolean requestFocusInWindow(boolean temporary)
Requests that this Component gets the input focus. Refer to Component.requestFocusInWindow(boolean) sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean) for a complete description of this method.

If you would like more information on focus, see

Overrides:
requestFocusInWindow sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
temporary - boolean indicating if the focus change is temporary
Returns:
false if the focus change request is guaranteed to fail; true if it is likely to succeed
Since:
1.4
See Also:
Component.requestFocusInWindow() sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() , Component.requestFocusInWindow(boolean) sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean)

grabFocus sample code for javax.swing.JComponent.grabFocus() definition code for javax.swing.JComponent.grabFocus()

public void grabFocus()
Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window. This component must be displayable, visible, and focusable for the request to be granted.

This method is intended for use by focus implementations. Client code should not use this method; instead, it should use requestFocusInWindow().

See Also:
requestFocusInWindow() sample code for javax.swing.JComponent.requestFocusInWindow() definition code for javax.swing.JComponent.requestFocusInWindow()

setVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean)

public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)
Sets the value to indicate whether input verifier for the current focus owner will be called before this component requests focus. The default is true. Set to false on components such as a Cancel button or a scrollbar, which should activate even if the input in the current focus owner is not "passed" by the input verifier for that component.

Parameters:
verifyInputWhenFocusTarget - value for the verifyInputWhenFocusTarget property
Since:
1.3
See Also:
InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier , setInputVerifier(javax.swing.InputVerifier) sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , getInputVerifier() sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , getVerifyInputWhenFocusTarget() sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget()

getVerifyInputWhenFocusTarget sample code for javax.swing.JComponent.getVerifyInputWhenFocusTarget() definition code for javax.swing.JComponent.getVerifyInputWhenFocusTarget()

public boolean getVerifyInputWhenFocusTarget()
Returns the value that indicates whether the input verifier for the current focus owner will be called before this component requests focus.

Returns:
value of the verifyInputWhenFocusTarget property
Since:
1.3
See Also:
InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier , setInputVerifier(javax.swing.InputVerifier) sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) , getInputVerifier() sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier() , setVerifyInputWhenFocusTarget(boolean) sample code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean) definition code for javax.swing.JComponent.setVerifyInputWhenFocusTarget(boolean)

getFontMetrics sample code for javax.swing.JComponent.getFontMetrics(java.awt.Font) definition code for javax.swing.JComponent.getFontMetrics(java.awt.Font)

public FontMetrics sample code for java.awt.FontMetrics definition code for java.awt.FontMetrics  getFontMetrics(Font sample code for java.awt.Font definition code for java.awt.Font  font)
Gets the FontMetrics for the specified Font.

Overrides:
getFontMetrics sample code for java.awt.Component.getFontMetrics(java.awt.Font) definition code for java.awt.Component.getFontMetrics(java.awt.Font) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
font - the font for which font metrics is to be obtained
Returns:
the font metrics for font
Throws:
NullPointerException sample code for java.lang.NullPointerException definition code for java.lang.NullPointerException - if font is null
Since:
1.5
See Also:
Component.getFont() sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , Component.getPeer() sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , ComponentPeer.getFontMetrics(Font) sample code for java.awt.peer.ComponentPeer.getFontMetrics(java.awt.Font) definition code for java.awt.peer.ComponentPeer.getFontMetrics(java.awt.Font) , Toolkit.getFontMetrics(Font) sample code for java.awt.Toolkit.getFontMetrics(java.awt.Font) definition code for java.awt.Toolkit.getFontMetrics(java.awt.Font)

setPreferredSize sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension)

public void setPreferredSize(Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  preferredSize)
Sets the preferred size of this component. If preferredSize is null, the UI will be asked for the preferred size.

Overrides:
setPreferredSize sample code for java.awt.Component.setPreferredSize(java.awt.Dimension) definition code for java.awt.Component.setPreferredSize(java.awt.Dimension) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
preferredSize - The new preferred size, or null
See Also:
Component.getPreferredSize() sample code for java.awt.Component.getPreferredSize() definition code for java.awt.Component.getPreferredSize() , Component.isPreferredSizeSet() sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet()

getPreferredSize sample code for javax.swing.JComponent.getPreferredSize() definition code for javax.swing.JComponent.getPreferredSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getPreferredSize()
If the preferredSize has been set to a non-null value just returns it. If the UI delegate's getPreferredSize method returns a non null value then return that; otherwise defer to the component's layout manager.

Overrides:
getPreferredSize sample code for java.awt.Container.getPreferredSize() definition code for java.awt.Container.getPreferredSize() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
the value of the preferredSize property
See Also:
setPreferredSize(java.awt.Dimension) sample code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) definition code for javax.swing.JComponent.setPreferredSize(java.awt.Dimension) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

setMaximumSize sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension)

public void setMaximumSize(Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  maximumSize)
Sets the maximum size of this component to a constant value. Subsequent calls to getMaximumSize will always return this value; the component's UI will not be asked to compute it. Setting the maximum size to null restores the default behavior.

Overrides:
setMaximumSize sample code for java.awt.Component.setMaximumSize(java.awt.Dimension) definition code for java.awt.Component.setMaximumSize(java.awt.Dimension) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
maximumSize - a Dimension containing the desired maximum allowable size
See Also:
getMaximumSize() sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize()

getMaximumSize sample code for javax.swing.JComponent.getMaximumSize() definition code for javax.swing.JComponent.getMaximumSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getMaximumSize()
If the maximum size has been set to a non-null value just returns it. If the UI delegate's getMaximumSize method returns a non-null value then return that; otherwise defer to the component's layout manager.

Overrides:
getMaximumSize sample code for java.awt.Container.getMaximumSize() definition code for java.awt.Container.getMaximumSize() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
the value of the maximumSize property
See Also:
setMaximumSize(java.awt.Dimension) sample code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMaximumSize(java.awt.Dimension) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

setMinimumSize sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension)

public void setMinimumSize(Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  minimumSize)
Sets the minimum size of this component to a constant value. Subsequent calls to getMinimumSize will always return this value; the component's UI will not be asked to compute it. Setting the minimum size to null restores the default behavior.

Overrides:
setMinimumSize sample code for java.awt.Component.setMinimumSize(java.awt.Dimension) definition code for java.awt.Component.setMinimumSize(java.awt.Dimension) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
minimumSize - the new minimum size of this component
See Also:
getMinimumSize() sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize()

getMinimumSize sample code for javax.swing.JComponent.getMinimumSize() definition code for javax.swing.JComponent.getMinimumSize()

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getMinimumSize()
If the minimum size has been set to a non-null value just returns it. If the UI delegate's getMinimumSize method returns a non-null value then return that; otherwise defer to the component's layout manager.

Overrides:
getMinimumSize sample code for java.awt.Container.getMinimumSize() definition code for java.awt.Container.getMinimumSize() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
the value of the minimumSize property
See Also:
setMinimumSize(java.awt.Dimension) sample code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) definition code for javax.swing.JComponent.setMinimumSize(java.awt.Dimension) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

contains sample code for javax.swing.JComponent.contains(int, int) definition code for javax.swing.JComponent.contains(int, int)

public boolean contains(int x,
                        int y)
Gives the UI delegate an opportunity to define the precise shape of this component for the sake of mouse processing.

Overrides:
contains sample code for java.awt.Component.contains(int, int) definition code for java.awt.Component.contains(int, int) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
x - the x coordinate of the point
y - the y coordinate of the point
Returns:
true if this component logically contains x,y
See Also:
Component.contains(int, int) sample code for java.awt.Component.contains(int, int) definition code for java.awt.Component.contains(int, int) , ComponentUI sample code for javax.swing.plaf.ComponentUI definition code for javax.swing.plaf.ComponentUI

setBorder sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border)

public void setBorder(Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border  border)
Sets the border of this component. The Border object is responsible for defining the insets for the component (overriding any insets set directly on the component) and for optionally rendering any border decorations within the bounds of those insets. Borders should be used (rather than insets) for creating both decorative and non-decorative (such as margins and padding) regions for a swing component. Compound borders can be used to nest multiple borders within a single component.

Although technically you can set the border on any object that inherits from JComponent, the look and feel implementation of many standard Swing components doesn't work well with user-set borders. In general, when you want to set a border on a standard Swing component other than JPanel or JLabel, we recommend that you put the component in a JPanel and set the border on the JPanel.

This is a bound property.

Parameters:
border - the border to be rendered for this component
See Also:
Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border , CompoundBorder sample code for javax.swing.border.CompoundBorder definition code for javax.swing.border.CompoundBorder

getBorder sample code for javax.swing.JComponent.getBorder() definition code for javax.swing.JComponent.getBorder()

public Border sample code for javax.swing.border.Border definition code for javax.swing.border.Border  getBorder()
Returns the border of this component or null if no border is currently set.

Returns:
the border object for this component
See Also:
setBorder(javax.swing.border.Border) sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border)

getInsets sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets()

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getInsets()
If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets.

Overrides:
getInsets sample code for java.awt.Container.getInsets() definition code for java.awt.Container.getInsets() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
the value of the insets property
See Also:
setBorder(javax.swing.border.Border) sample code for javax.swing.JComponent.setBorder(javax.swing.border.Border) definition code for javax.swing.JComponent.setBorder(javax.swing.border.Border)

getInsets sample code for javax.swing.JComponent.getInsets(java.awt.Insets) definition code for javax.swing.JComponent.getInsets(java.awt.Insets)

public Insets sample code for java.awt.Insets definition code for java.awt.Insets  getInsets(Insets sample code for java.awt.Insets definition code for java.awt.Insets  insets)
Returns an Insets object containing this component's inset values. The passed-in Insets object will be reused if possible. Calling methods cannot assume that the same object will be returned, however. All existing values within this object are overwritten. If insets is null, this will allocate a new one.

Parameters:
insets - the Insets object, which can be reused
Returns:
the Insets object
See Also:
getInsets() sample code for javax.swing.JComponent.getInsets() definition code for javax.swing.JComponent.getInsets()

getAlignmentY sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY()

public float getAlignmentY()
Overrides Container.getAlignmentY to return the horizontal alignment.

Overrides:
getAlignmentY sample code for java.awt.Container.getAlignmentY() definition code for java.awt.Container.getAlignmentY() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
the value of the alignmentY property
See Also:
setAlignmentY(float) sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float) , Component.getAlignmentY() sample code for java.awt.Component.getAlignmentY() definition code for java.awt.Component.getAlignmentY()

setAlignmentY sample code for javax.swing.JComponent.setAlignmentY(float) definition code for javax.swing.JComponent.setAlignmentY(float)

public void setAlignmentY(float alignmentY)
Sets the the horizontal alignment.

Parameters:
alignmentY - the new horizontal alignment
See Also:
getAlignmentY() sample code for javax.swing.JComponent.getAlignmentY() definition code for javax.swing.JComponent.getAlignmentY()

getAlignmentX sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX()

public float getAlignmentX()
Overrides Container.getAlignmentX to return the vertical alignment.

Overrides:
getAlignmentX sample code for java.awt.Container.getAlignmentX() definition code for java.awt.Container.getAlignmentX() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
the value of the alignmentX property
See Also:
setAlignmentX(float) sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float) , Component.getAlignmentX() sample code for java.awt.Component.getAlignmentX() definition code for java.awt.Component.getAlignmentX()

setAlignmentX sample code for javax.swing.JComponent.setAlignmentX(float) definition code for javax.swing.JComponent.setAlignmentX(float)

public void setAlignmentX(float alignmentX)
Sets the the vertical alignment.

Parameters:
alignmentX - the new vertical alignment
See Also:
getAlignmentX() sample code for javax.swing.JComponent.getAlignmentX() definition code for javax.swing.JComponent.getAlignmentX()

setInputVerifier sample code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier) definition code for javax.swing.JComponent.setInputVerifier(javax.swing.InputVerifier)

public void setInputVerifier(InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier  inputVerifier)
Sets the input verifier for this component.

Parameters:
inputVerifier - the new input verifier
Since:
1.3
See Also:
InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier

getInputVerifier sample code for javax.swing.JComponent.getInputVerifier() definition code for javax.swing.JComponent.getInputVerifier()

public InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier  getInputVerifier()
Returns the input verifier for this component.

Returns:
the inputVerifier property
Since:
1.3
See Also:
InputVerifier sample code for javax.swing.InputVerifier definition code for javax.swing.InputVerifier

getGraphics sample code for javax.swing.JComponent.getGraphics() definition code for javax.swing.JComponent.getGraphics()

public Graphics sample code for java.awt.Graphics definition code for java.awt.Graphics  getGraphics()
Returns this component's graphics context, which lets you draw on a component. Use this method get a Graphics object and then invoke operations on that object to draw on the component.

Overrides:
getGraphics sample code for java.awt.Component.getGraphics() definition code for java.awt.Component.getGraphics() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
this components graphics context
See Also:
Component.paint(java.awt.Graphics) sample code for java.awt.Component.paint(java.awt.Graphics) definition code for java.awt.Component.paint(java.awt.Graphics)

setDebugGraphicsOptions sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int)

public void setDebugGraphicsOptions(int debugOptions)
Enables or disables diagnostic information about every graphics operation performed within the component or one of its children.

Parameters:
debugOptions - determines how the component should display the information; one of the following options:
  • DebugGraphics.LOG_OPTION - causes a text message to be printed.
  • DebugGraphics.FLASH_OPTION - causes the drawing to flash several times.
  • DebugGraphics.BUFFERED_OPTION - creates an ExternalWindow that displays the operations performed on the View's offscreen buffer.
  • DebugGraphics.NONE_OPTION disables debugging.
  • A value of 0 causes no changes to the debugging options.
debugOptions is bitwise OR'd into the current value

getDebugGraphicsOptions sample code for javax.swing.JComponent.getDebugGraphicsOptions() definition code for javax.swing.JComponent.getDebugGraphicsOptions()

public int getDebugGraphicsOptions()
Returns the state of graphics debugging.

Returns:
a bitwise OR'd flag of zero or more of the following options:
  • DebugGraphics.LOG_OPTION - causes a text message to be printed.
  • DebugGraphics.FLASH_OPTION - causes the drawing to flash several times.
  • DebugGraphics.BUFFERED_OPTION - creates an ExternalWindow that displays the operations performed on the View's offscreen buffer.
  • DebugGraphics.NONE_OPTION disables debugging.
  • A value of 0 causes no changes to the debugging options.
See Also:
setDebugGraphicsOptions(int) sample code for javax.swing.JComponent.setDebugGraphicsOptions(int) definition code for javax.swing.JComponent.setDebugGraphicsOptions(int)

registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)

public void registerKeyboardAction(ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  anAction,
                                   String sample code for java.lang.String definition code for java.lang.String  aCommand,
                                   KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke,
                                   int aCondition)
This method is now obsolete, please use a combination of getActionMap() and getInputMap() for similiar behavior. For example, to bind the KeyStroke aKeyStroke to the Action anAction now use:
   component.getInputMap().put(aKeyStroke, aCommand);
   component.getActionMap().put(aCommmand, anAction);
 
The above assumes you want the binding to be applicable for WHEN_FOCUSED. To register bindings for other focus states use the getInputMap method that takes an integer.

Register a new keyboard action. anAction will be invoked if a key event matching aKeyStroke occurs and aCondition is verified. The KeyStroke object defines a particular combination of a keyboard key and one or more modifiers (alt, shift, ctrl, meta).

The aCommand will be set in the delivered event if specified.

The aCondition can be one of:

WHEN_FOCUSED
The action will be invoked only when the keystroke occurs while the component has the focus.
WHEN_IN_FOCUSED_WINDOW
The action will be invoked when the keystroke occurs while the component has the focus or if the component is in the window that has the focus. Note that the component need not be an immediate descendent of the window -- it can be anywhere in the window's containment hierarchy. In other words, whenever any component in the window has the focus, the action registered with this component is invoked.
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
The action will be invoked when the keystroke occurs while the component has the focus or if the component is an ancestor of the component that has the focus.

The combination of keystrokes and conditions lets you define high level (semantic) action events for a specified keystroke+modifier combination (using the KeyStroke class) and direct to a parent or child of a component that has the focus, or to the component itself. In other words, in any hierarchical structure of components, an arbitrary key-combination can be immediately directed to the appropriate component in the hierarchy, and cause a specific method to be invoked (usually by way of adapter objects).

If an action has already been registered for the receiving container, with the same charCode and the same modifiers, anAction will replace the action.

Parameters:
anAction - the Action to be registered
aCommand - the command to be set in the delivered event
aKeyStroke - the KeyStroke to bind to the action
aCondition - the condition that needs to be met, see above
See Also:
KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke

registerKeyboardAction sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, javax.swing.KeyStroke, int)

public void registerKeyboardAction(ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  anAction,
                                   KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke,
                                   int aCondition)
This method is now obsolete, please use a combination of getActionMap() and getInputMap() for similiar behavior.


unregisterKeyboardAction sample code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke) definition code for javax.swing.JComponent.unregisterKeyboardAction(javax.swing.KeyStroke)

public void unregisterKeyboardAction(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke)
This method is now obsolete. To unregister an existing binding you can either remove the binding from the ActionMap/InputMap, or place a dummy binding the InputMap. Removing the binding from the InputMap allows bindings in parent InputMaps to be active, whereas putting a dummy binding in the InputMap effectively disables the binding from ever happening.

Unregisters a keyboard action. This will remove the binding from the ActionMap (if it exists) as well as the InputMaps.


getRegisteredKeyStrokes sample code for javax.swing.JComponent.getRegisteredKeyStrokes() definition code for javax.swing.JComponent.getRegisteredKeyStrokes()

public KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke [] getRegisteredKeyStrokes()
Returns the KeyStrokes that will initiate registered actions.

Returns:
an array of KeyStroke objects
See Also:
registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)

getConditionForKeyStroke sample code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getConditionForKeyStroke(javax.swing.KeyStroke)

public int getConditionForKeyStroke(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke)
Returns the condition that determines whether a registered action occurs in response to the specified keystroke.

For Java 2 platform v1.3, a KeyStroke can be associated with more than one condition. For example, 'a' could be bound for the two conditions WHEN_FOCUSED and WHEN_IN_FOCUSED_WINDOW condition.

Returns:
the action-keystroke condition

getActionForKeyStroke sample code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke) definition code for javax.swing.JComponent.getActionForKeyStroke(javax.swing.KeyStroke)

public ActionListener sample code for java.awt.event.ActionListener definition code for java.awt.event.ActionListener  getActionForKeyStroke(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  aKeyStroke)
Returns the object that will perform the action registered for a given keystroke.

Returns:
the ActionListener object invoked when the keystroke occurs

resetKeyboardActions sample code for javax.swing.JComponent.resetKeyboardActions() definition code for javax.swing.JComponent.resetKeyboardActions()

public void resetKeyboardActions()
Unregisters all the bindings in the first tier InputMaps and ActionMap. This has the effect of removing any local bindings, and allowing the bindings defined in parent InputMap/ActionMaps (the UI is usually defined in the second tier) to persist.


setInputMap sample code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap) definition code for javax.swing.JComponent.setInputMap(int, javax.swing.InputMap)

public final void setInputMap(int condition,
                              InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap  map)
Sets the InputMap to use under the condition condition to map. A null value implies you do not want any bindings to be used, even from the UI. This will not reinstall the UI InputMap (if there was one). condition has one of the following values:
  • WHEN_IN_FOCUSED_WINDOW
  • WHEN_FOCUSED
  • WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
If condition is WHEN_IN_FOCUSED_WINDOW and map is not a ComponentInputMap, an IllegalArgumentException will be thrown. Similarly, if condition is not one of the values listed, an IllegalArgumentException will be thrown.

Parameters:
condition - one of the values listed above
map - the InputMap to use for the given condition
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if condition is WHEN_IN_FOCUSED_WINDOW and map is not an instance of ComponentInputMap; or if condition is not one of the legal values specified above
Since:
1.3

getInputMap sample code for javax.swing.JComponent.getInputMap(int) definition code for javax.swing.JComponent.getInputMap(int)

public final InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap  getInputMap(int condition)
Returns the InputMap that is used during condition.

Parameters:
condition - one of WHEN_IN_FOCUSED_WINDOW, WHEN_FOCUSED, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
Returns:
the InputMap for the specified condition
Since:
1.3

getInputMap sample code for javax.swing.JComponent.getInputMap() definition code for javax.swing.JComponent.getInputMap()

public final InputMap sample code for javax.swing.InputMap definition code for javax.swing.InputMap  getInputMap()
Returns the InputMap that is used when the component has focus. This is convenience method for getInputMap(WHEN_FOCUSED).

Returns:
the InputMap used when the component has focus
Since:
JDK1.3

setActionMap sample code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap) definition code for javax.swing.JComponent.setActionMap(javax.swing.ActionMap)

public final void setActionMap(ActionMap sample code for javax.swing.ActionMap definition code for javax.swing.ActionMap  am)
Sets the ActionMap to am. This does not set the parent of the am to be the ActionMap from the UI (if there was one), it is up to the caller to have done this.

Parameters:
am - the new ActionMap
Since:
1.3

getActionMap sample code for javax.swing.JComponent.getActionMap() definition code for javax.swing.JComponent.getActionMap()

public final ActionMap sample code for javax.swing.ActionMap definition code for javax.swing.ActionMap  getActionMap()
Returns the ActionMap used to determine what Action to fire for particular KeyStroke binding. The returned ActionMap, unless otherwise set, will have the ActionMap from the UI set as the parent.

Returns:
the ActionMap containing the key/action bindings
Since:
1.3

requestDefaultFocus sample code for javax.swing.JComponent.requestDefaultFocus() definition code for javax.swing.JComponent.requestDefaultFocus()

@Deprecated
public boolean requestDefaultFocus()
Deprecated. As of 1.4, replaced by FocusTraversalPolicy.getDefaultComponent(Container).requestFocus()

In release 1.4, the focus subsystem was rearchitected. For more information, see How to Use the Focus Subsystem, a section in The Java Tutorial.

Requests focus on this JComponent's FocusTraversalPolicy's default Component. If this JComponent is a focus cycle root, then its FocusTraversalPolicy is used. Otherwise, the FocusTraversalPolicy of this JComponent's focus-cycle-root ancestor is used.

See Also:
FocusTraversalPolicy.getDefaultComponent(java.awt.Container) sample code for java.awt.FocusTraversalPolicy.getDefaultComponent(java.awt.Container) definition code for java.awt.FocusTraversalPolicy.getDefaultComponent(java.awt.Container)

setVisible sample code for javax.swing.JComponent.setVisible(boolean) definition code for javax.swing.JComponent.setVisible(boolean)

public void setVisible(boolean aFlag)
Makes the component visible or invisible. Overrides Component.setVisible.

Overrides:
setVisible sample code for java.awt.Component.setVisible(boolean) definition code for java.awt.Component.setVisible(boolean) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
aFlag - true to make the component visible; false to make it invisible
See Also:
Component.isVisible() sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible()

setEnabled sample code for javax.swing.JComponent.setEnabled(boolean) definition code for javax.swing.JComponent.setEnabled(boolean)

public void setEnabled(boolean enabled)
Sets whether or not this component is enabled. A component that is enabled may respond to user input, while a component that is not enabled cannot respond to user input. Some components may alter their visual representation when they are disabled in order to provide feedback to the user that they cannot take input.

Note: Disabling a component does not disable it's children.

Note: Disabling a lightweight component does not prevent it from receiving MouseEvents.

Overrides:
setEnabled sample code for java.awt.Component.setEnabled(boolean) definition code for java.awt.Component.setEnabled(boolean) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
enabled - true if this component should be enabled, false otherwise
See Also:
Component.isEnabled() sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , Component.isLightweight() sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight()

setForeground sample code for javax.swing.JComponent.setForeground(java.awt.Color) definition code for javax.swing.JComponent.setForeground(java.awt.Color)

public void setForeground(Color sample code for java.awt.Color definition code for java.awt.Color  fg)
Sets the foreground color of this component.

Overrides:
setForeground sample code for java.awt.Component.setForeground(java.awt.Color) definition code for java.awt.Component.setForeground(java.awt.Color) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
fg - the desired foreground Color
See Also:
Component.getForeground() sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground()

setBackground sample code for javax.swing.JComponent.setBackground(java.awt.Color) definition code for javax.swing.JComponent.setBackground(java.awt.Color)

public void setBackground(Color sample code for java.awt.Color definition code for java.awt.Color  bg)
Sets the background color of this component.

Overrides:
setBackground sample code for java.awt.Component.setBackground(java.awt.Color) definition code for java.awt.Component.setBackground(java.awt.Color) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
bg - the desired background Color
See Also:
Component.getBackground() sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground()

setFont sample code for javax.swing.JComponent.setFont(java.awt.Font) definition code for javax.swing.JComponent.setFont(java.awt.Font)

public void setFont(Font sample code for java.awt.Font definition code for java.awt.Font  font)
Sets the font for this component.

Overrides:
setFont sample code for java.awt.Container.setFont(java.awt.Font) definition code for java.awt.Container.setFont(java.awt.Font) in class Container sample code for java.awt.Container definition code for java.awt.Container
Parameters:
font - the desired Font for this component
See Also:
Component.getFont() sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont()

getDefaultLocale sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale()

public static Locale sample code for java.util.Locale definition code for java.util.Locale  getDefaultLocale()
Returns the default locale used to initialize each JComponent's locale property upon creation. The default locale has "AppContext" scope so that applets (and potentially multiple lightweight applications running in a single VM) can have their own setting. An applet can safely alter its default locale because it will have no affect on other applets (or the browser).

Returns:
the default Locale.
Since:
1.4
See Also:
setDefaultLocale(java.util.Locale) sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) , Component.getLocale() sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , Component.setLocale(java.util.Locale) sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale)

setDefaultLocale sample code for javax.swing.JComponent.setDefaultLocale(java.util.Locale) definition code for javax.swing.JComponent.setDefaultLocale(java.util.Locale)

public static void setDefaultLocale(Locale sample code for java.util.Locale definition code for java.util.Locale  l)
Sets the default locale used to initialize each JComponent's locale property upon creation. The initial value is the VM's default locale. The default locale has "AppContext" scope so that applets (and potentially multiple lightweight applications running in a single VM) can have their own setting. An applet can safely alter its default locale because it will have no affect on other applets (or the browser).

Parameters:
l - the desired default Locale for new components.
Since:
1.4
See Also:
getDefaultLocale() sample code for javax.swing.JComponent.getDefaultLocale() definition code for javax.swing.JComponent.getDefaultLocale() , Component.getLocale() sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , Component.setLocale(java.util.Locale) sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale)

processComponentKeyEvent sample code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processComponentKeyEvent(java.awt.event.KeyEvent)

protected void processComponentKeyEvent(KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e)
Processes any key events that the component itself recognizes. This is called after the focus manager and any interested listeners have been given a chance to steal away the event. This method is called only if the event has not yet been consumed. This method is called prior to the keyboard UI logic.

This method is implemented to do nothing. Subclasses would normally override this method if they process some key events themselves. If the event is processed, it should be consumed.


processKeyEvent sample code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent) definition code for javax.swing.JComponent.processKeyEvent(java.awt.event.KeyEvent)

protected void processKeyEvent(KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e)
Overrides processKeyEvent to process events.

Overrides:
processKeyEvent sample code for java.awt.Component.processKeyEvent(java.awt.event.KeyEvent) definition code for java.awt.Component.processKeyEvent(java.awt.event.KeyEvent) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
e - the key event
See Also:
KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent , KeyListener sample code for java.awt.event.KeyListener definition code for java.awt.event.KeyListener , KeyboardFocusManager sample code for java.awt.KeyboardFocusManager definition code for java.awt.KeyboardFocusManager , DefaultKeyboardFocusManager sample code for java.awt.DefaultKeyboardFocusManager definition code for java.awt.DefaultKeyboardFocusManager , Component.processEvent(java.awt.AWTEvent) sample code for java.awt.Component.processEvent(java.awt.AWTEvent) definition code for java.awt.Component.processEvent(java.awt.AWTEvent) , Component.dispatchEvent(java.awt.AWTEvent) sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , Component.addKeyListener(java.awt.event.KeyListener) sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , Component.enableEvents(long) sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , Component.isShowing() sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing()

processKeyBinding sample code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean) definition code for javax.swing.JComponent.processKeyBinding(javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean)

protected boolean processKeyBinding(KeyStroke sample code for javax.swing.KeyStroke definition code for javax.swing.KeyStroke  ks,
                                    KeyEvent sample code for java.awt.event.KeyEvent definition code for java.awt.event.KeyEvent  e,
                                    int condition,
                                    boolean pressed)
Invoked to process the key bindings for ks as the result of the KeyEvent e. This obtains the appropriate InputMap, gets the binding, gets the action from the ActionMap, and then (if the action is found and the component is enabled) invokes notifyAction to notify the action.

Parameters:
ks - the KeyStroke queried
e - the KeyEvent
condition - one of the following values:
  • JComponent.WHEN_FOCUSED
  • JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
  • JComponent.WHEN_IN_FOCUSED_WINDOW
pressed - true if the key is pressed
Returns:
true if there was a binding to an action, and the action was enabled
Since:
1.3

setToolTipText sample code for javax.swing.JComponent.setToolTipText(java.lang.String) definition code for javax.swing.JComponent.setToolTipText(java.lang.String)

public void setToolTipText(String sample code for java.lang.String definition code for java.lang.String  text)
Registers the text to display in a tool tip. The text displays when the cursor lingers over the component.

See How to Use Tool Tips in The Java Tutorial for further documentation.

Parameters:
text - the string to display; if the text is null, the tool tip is turned off for this component
See Also:
TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY

getToolTipText sample code for javax.swing.JComponent.getToolTipText() definition code for javax.swing.JComponent.getToolTipText()

public String sample code for java.lang.String definition code for java.lang.String  getToolTipText()
Returns the tooltip string that has been set with setToolTipText.

Returns:
the text of the tool tip
See Also:
TOOL_TIP_TEXT_KEY sample code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY definition code for javax.swing.JComponent.TOOL_TIP_TEXT_KEY

getToolTipText sample code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipText(java.awt.event.MouseEvent)

public String sample code for java.lang.String definition code for java.lang.String  getToolTipText(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
Returns the string to be used as the tooltip for event. By default this returns any string set using setToolTipText. If a component provides more extensive API to support differing tooltips at different locations, this method should be overridden.


getToolTipLocation sample code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getToolTipLocation(java.awt.event.MouseEvent)

public Point sample code for java.awt.Point definition code for java.awt.Point  getToolTipLocation(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
Returns the tooltip location in this component's coordinate system. If null is returned, Swing will choose a location. The default implementation returns null.

Parameters:
event - the MouseEvent that caused the ToolTipManager to show the tooltip
Returns:
always returns null

getPopupLocation sample code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.getPopupLocation(java.awt.event.MouseEvent)

public Point sample code for java.awt.Point definition code for java.awt.Point  getPopupLocation(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  event)
Returns the preferred location to display the popup menu in this component's coordinate system. It is up to the look and feel to honor this propery, some may choose to ignore it. If null is truend the look and feel will choose a suitable location.

Parameters:
event - the MouseEvent that triggered the popup to be shown, or null if popup was is not being shown as the result of a mouse event
Returns:
Locatino to display the JPopupMenu.
Since:
1.5

createToolTip sample code for javax.swing.JComponent.createToolTip() definition code for javax.swing.JComponent.createToolTip()

public JToolTip sample code for javax.swing.JToolTip definition code for javax.swing.JToolTip  createToolTip()
Returns the instance of JToolTip that should be used to display the tooltip. Components typically would not override this method, but it can be used to cause different tooltips to be displayed differently.

Returns:
the JToolTip used to display this toolTip

scrollRectToVisible sample code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle) definition code for javax.swing.JComponent.scrollRectToVisible(java.awt.Rectangle)

public void scrollRectToVisible(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  aRect)
Forwards the scrollRectToVisible() message to the JComponent's parent. Components that can service the request, such as JViewport, override this method and perform the scrolling.

Parameters:
aRect - the visible Rectangle
See Also:
JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport

setAutoscrolls sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean)

public void setAutoscrolls(boolean autoscrolls)
Sets the autoscrolls property. If true mouse dragged events will be synthetically generated when the mouse is dragged outside of the component's bounds and mouse motion has paused (while the button continues to be held down). The synthetic events make it appear that the drag gesture has resumed in the direction established when the component's boundary was crossed. Components that support autoscrolling must handle mouseDragged events by calling scrollRectToVisible with a rectangle that contains the mouse event's location. All of the Swing components that support item selection and are typically displayed in a JScrollPane (JTable, JList, JTree, JTextArea, and JEditorPane) already handle mouse dragged events in this way. To enable autoscrolling in any other component, add a mouse motion listener that calls scrollRectToVisible. For example, given a JPanel, myPanel:
 MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() {
     public void mouseDragged(MouseEvent e) {
        Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1);
        ((JPanel)e.getSource()).scrollRectToVisible(r);
    }
 };
 myPanel.addMouseMotionListener(doScrollRectToVisible);
 
The default value of the autoScrolls property is false.

Parameters:
autoscrolls - if true, synthetic mouse dragged events are generated when the mouse is dragged outside of a component's bounds and the mouse button continues to be held down; otherwise false
See Also:
getAutoscrolls() sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls() , JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport , JScrollPane sample code for javax.swing.JScrollPane definition code for javax.swing.JScrollPane

getAutoscrolls sample code for javax.swing.JComponent.getAutoscrolls() definition code for javax.swing.JComponent.getAutoscrolls()

public boolean getAutoscrolls()
Gets the autoscrolls property.

Returns:
the value of the autoscrolls property
See Also:
JViewport sample code for javax.swing.JViewport definition code for javax.swing.JViewport , setAutoscrolls(boolean) sample code for javax.swing.JComponent.setAutoscrolls(boolean) definition code for javax.swing.JComponent.setAutoscrolls(boolean)

setTransferHandler sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler)

public void setTransferHandler(TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler  newHandler)
Sets the transferHandler property, which is null if the component does not support data transfer operations.

If newHandler is not null, and the system property suppressSwingDropSupport is not true, this will install a DropTarget on the JComponent. The default for the system property is false, so that a DropTarget will be added.

Please see How to Use Drag and Drop and Data Transfer, a section in The Java Tutorial, for more information.

Parameters:
newHandler - mechanism for transfer of data to and from the component
Since:
1.4
See Also:
TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler , getTransferHandler() sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler()

getTransferHandler sample code for javax.swing.JComponent.getTransferHandler() definition code for javax.swing.JComponent.getTransferHandler()

public TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler  getTransferHandler()
Gets the transferHandler property.

Returns:
the value of the transferHandler property
Since:
1.4
See Also:
TransferHandler sample code for javax.swing.TransferHandler definition code for javax.swing.TransferHandler , setTransferHandler(javax.swing.TransferHandler) sample code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler) definition code for javax.swing.JComponent.setTransferHandler(javax.swing.TransferHandler)

processMouseEvent sample code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseEvent(java.awt.event.MouseEvent)

protected void processMouseEvent(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects, refer to Component.processMouseEvent(MouseEvent) sample code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) for a complete description of this method.

Overrides:
processMouseEvent sample code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
e - the mouse event
Since:
1.5
See Also:
Component.processMouseEvent(java.awt.event.MouseEvent) sample code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent)

processMouseMotionEvent sample code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for javax.swing.JComponent.processMouseMotionEvent(java.awt.event.MouseEvent)

protected void processMouseMotionEvent(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Processes mouse motion events, such as MouseEvent.MOUSE_DRAGGED.

Overrides:
processMouseMotionEvent sample code for java.awt.Component.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseMotionEvent(java.awt.event.MouseEvent) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
e - the MouseEvent
See Also:
MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent

enable sample code for javax.swing.JComponent.enable() definition code for javax.swing.JComponent.enable()

@Deprecated
public void enable()
Deprecated. As of JDK version 1.1, replaced by java.awt.Component.setEnabled(boolean).

Overrides:
enable sample code for java.awt.Component.enable() definition code for java.awt.Component.enable() in class Component sample code for java.awt.Component definition code for java.awt.Component

disable sample code for javax.swing.JComponent.disable() definition code for javax.swing.JComponent.disable()

@Deprecated
public void disable()
Deprecated. As of JDK version 1.1, replaced by java.awt.Component.setEnabled(boolean).

Overrides:
disable sample code for java.awt.Component.disable() definition code for java.awt.Component.disable() in class Component sample code for java.awt.Component definition code for java.awt.Component

getAccessibleContext sample code for javax.swing.JComponent.getAccessibleContext() definition code for javax.swing.JComponent.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Returns the AccessibleContext associated with this JComponent. The method implemented by this base class returns null. Classes that extend JComponent should implement this method to return the AccessibleContext associated with the subclass.

Overrides:
getAccessibleContext sample code for java.awt.Component.getAccessibleContext() definition code for java.awt.Component.getAccessibleContext() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the AccessibleContext of this JComponent

getClientProperty sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object)

public final Object sample code for java.lang.Object definition code for java.lang.Object  getClientProperty(Object sample code for java.lang.Object definition code for java.lang.Object  key)
Returns the value of the property with the specified key. Only properties added with putClientProperty will return a non-null value.

Parameters:
key - the being queried
Returns:
the value of this property or null
See Also:
putClientProperty(java.lang.Object, java.lang.Object) sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object)

putClientProperty sample code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.putClientProperty(java.lang.Object, java.lang.Object)

public final void putClientProperty(Object sample code for java.lang.Object definition code for java.lang.Object  key,
                                    Object sample code for java.lang.Object definition code for java.lang.Object  value)
Adds an arbitrary key/value "client property" to this component.

The get/putClientProperty methods provide access to a small per-instance hashtable. Callers can use get/putClientProperty to annotate components that were created by another module. For example, a layout manager might store per child constraints this way. For example:

 componentA.putClientProperty("to the left of", componentB);
 
If value is null this method will remove the property. Changes to client properties are reported with PropertyChange events. The name of the property (for the sake of PropertyChange events) is key.toString().

The clientProperty dictionary is not intended to support large scale extensions to JComponent nor should be it considered an alternative to subclassing when designing a new component.

Parameters:
key - the new client property key
value - the new client property value; if null this method will remove the property
See Also:
getClientProperty(java.lang.Object) sample code for javax.swing.JComponent.getClientProperty(java.lang.Object) definition code for javax.swing.JComponent.getClientProperty(java.lang.Object) , Container.addPropertyChangeListener(java.beans.PropertyChangeListener) sample code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Container.addPropertyChangeListener(java.beans.PropertyChangeListener)

setFocusTraversalKeys sample code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>) definition code for javax.swing.JComponent.setFocusTraversalKeys(int, java.util.Set<? extends java.awt.AWTKeyStroke>)

public void setFocusTraversalKeys(int id,
                                  Set sample code for java.util.Set definition code for java.util.Set <? extends AWTKeyStroke sample code for java.awt.AWTKeyStroke definition code for java.awt.AWTKeyStroke > keystrokes)
Sets the focus traversal keys for a given traversal operation for this Component. Refer to Component.setFocusTraversalKeys(int, java.util.Set) sample code for java.awt.Component.setFocusTraversalKeys(int, java.util.Set) definition code for java.awt.Component.setFocusTraversalKeys(int, java.util.Set) for a complete description of this method.

Overrides:
setFocusTraversalKeys sample code for java.awt.Container.setFocusTraversalKeys(int, java.util.Set) definition code for java.awt.Container.setFocusTraversalKeys(int, java.util.Set) in class Container sample code for java.awt.Container definition code for java.awt.Container
Parameters:
id - one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS
keystrokes - the Set of AWTKeyStroke for the specified operation
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if id is not one of KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, or KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS, or if keystrokes contains null, or if any Object in keystrokes is not an AWTKeyStroke, or if any keystroke represents a KEY_TYPED event, or if any keystroke already maps to another focus traversal operation for this Component
Since:
1.5
See Also:
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS sample code for java.awt.KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS definition code for java.awt.KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS , KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS sample code for java.awt.KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS definition code for java.awt.KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS , KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS sample code for java.awt.KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS definition code for java.awt.KeyboardFocusManager.UP_CYCLE_TRAVERSAL_KEYS

isLightweightComponent sample code for javax.swing.JComponent.isLightweightComponent(java.awt.Component) definition code for javax.swing.JComponent.isLightweightComponent(java.awt.Component)

public static boolean isLightweightComponent(Component sample code for java.awt.Component definition code for java.awt.Component  c)
Returns true if this component is lightweight, that is, if it doesn't have a native window system peer.

Returns:
true if this component is lightweight

reshape sample code for javax.swing.JComponent.reshape(int, int, int, int) definition code for javax.swing.JComponent.reshape(int, int, int, int)

@Deprecated
public void reshape(int x,
                               int y,
                               int w,
                               int h)
Deprecated. As of JDK 5, replaced by Component.setBounds(int, int, int, int).

Moves and resizes this component.

Overrides:
reshape sample code for java.awt.Component.reshape(int, int, int, int) definition code for java.awt.Component.reshape(int, int, int, int) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
x - the new horizontal location
y - the new vertical location
w - the new width
h - the new height
See Also:
Component.setBounds(int, int, int, int) sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int)

getBounds sample code for javax.swing.JComponent.getBounds(java.awt.Rectangle) definition code for javax.swing.JComponent.getBounds(java.awt.Rectangle)

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getBounds(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  rv)
Stores the bounds of this component into "return value" rv and returns rv. If rv is null a new Rectangle is allocated. This version of getBounds is useful if the caller wants to avoid allocating a new Rectangle object on the heap.

Overrides:
getBounds sample code for java.awt.Component.getBounds(java.awt.Rectangle) definition code for java.awt.Component.getBounds(java.awt.Rectangle) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
rv - the return value, modified to the component's bounds
Returns:
rv; if rv is null return a newly created Rectangle with this component's bounds

getSize sample code for javax.swing.JComponent.getSize(java.awt.Dimension) definition code for javax.swing.JComponent.getSize(java.awt.Dimension)

public Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  getSize(Dimension sample code for java.awt.Dimension definition code for java.awt.Dimension  rv)
Stores the width/height of this component into "return value" rv and returns rv. If rv is null a new Dimension object is allocated. This version of getSize is useful if the caller wants to avoid allocating a new Dimension object on the heap.

Overrides:
getSize sample code for java.awt.Component.getSize(java.awt.Dimension) definition code for java.awt.Component.getSize(java.awt.Dimension) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
rv - the return value, modified to the component's size
Returns:
rv

getLocation sample code for javax.swing.JComponent.getLocation(java.awt.Point) definition code for javax.swing.JComponent.getLocation(java.awt.Point)

public Point sample code for java.awt.Point definition code for java.awt.Point  getLocation(Point sample code for java.awt.Point definition code for java.awt.Point  rv)
Stores the x,y origin of this component into "return value" rv and returns rv. If rv is null a new Point is allocated. This version of getLocation is useful if the caller wants to avoid allocating a new Point object on the heap.

Overrides:
getLocation sample code for java.awt.Component.getLocation(java.awt.Point) definition code for java.awt.Component.getLocation(java.awt.Point) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
rv - the return value, modified to the component's location
Returns:
rv

getX sample code for javax.swing.JComponent.getX() definition code for javax.swing.JComponent.getX()

public int getX()
Returns the current x coordinate of the component's origin. This method is preferable to writing component.getBounds().x, or component.getLocation().x because it doesn't cause any heap allocations.

Overrides:
getX sample code for java.awt.Component.getX() definition code for java.awt.Component.getX() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the current x coordinate of the component's origin

getY sample code for javax.swing.JComponent.getY() definition code for javax.swing.JComponent.getY()

public int getY()
Returns the current y coordinate of the component's origin. This method is preferable to writing component.getBounds().y, or component.getLocation().y because it doesn't cause any heap allocations.

Overrides:
getY sample code for java.awt.Component.getY() definition code for java.awt.Component.getY() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the current y coordinate of the component's origin

getWidth sample code for javax.swing.JComponent.getWidth() definition code for javax.swing.JComponent.getWidth()

public int getWidth()
Returns the current width of this component. This method is preferable to writing component.getBounds().width, or component.getSize().width because it doesn't cause any heap allocations.

Overrides:
getWidth sample code for java.awt.Component.getWidth() definition code for java.awt.Component.getWidth() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the current width of this component

getHeight sample code for javax.swing.JComponent.getHeight() definition code for javax.swing.JComponent.getHeight()

public int getHeight()
Returns the current height of this component. This method is preferable to writing component.getBounds().height, or component.getSize().height because it doesn't cause any heap allocations.

Overrides:
getHeight sample code for java.awt.Component.getHeight() definition code for java.awt.Component.getHeight() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the current height of this component

isOpaque sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque()

public boolean isOpaque()
Returns true if this component is completely opaque.

An opaque component paints every pixel within its rectangular bounds. A non-opaque component paints only a subset of its pixels or none at all, allowing the pixels underneath it to "show through". Therefore, a component that does not fully paint its pixels provides a degree of transparency.

Subclasses that guarantee to always completely paint their contents should override this method and return true.

Overrides:
isOpaque sample code for java.awt.Component.isOpaque() definition code for java.awt.Component.isOpaque() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
true if this component is completely opaque
See Also:
setOpaque(boolean) sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean)

setOpaque sample code for javax.swing.JComponent.setOpaque(boolean) definition code for javax.swing.JComponent.setOpaque(boolean)

public void setOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds. Otherwise, the component may not paint some or all of its pixels, allowing the underlying pixels to show through.

The default value of this property is false for JComponent. However, the default value for this property on most standard JComponent subclasses (such as JButton and JTree) is look-and-feel dependent.

Parameters:
isOpaque - true if this component should be opaque
See Also:
isOpaque() sample code for javax.swing.JComponent.isOpaque() definition code for javax.swing.JComponent.isOpaque()

computeVisibleRect sample code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle) definition code for javax.swing.JComponent.computeVisibleRect(java.awt.Rectangle)

public void computeVisibleRect(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  visibleRect)
Returns the Component's "visible rect rectangle" - the intersection of the visible rectangles for this component and all of its ancestors. The return value is stored in visibleRect.

Parameters:
visibleRect - a Rectangle computed as the intersection of all visible rectangles for this component and all of its ancestors -- this is the return value for this method
See Also:
getVisibleRect() sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect()

getVisibleRect sample code for javax.swing.JComponent.getVisibleRect() definition code for javax.swing.JComponent.getVisibleRect()

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getVisibleRect()
Returns the Component's "visible rectangle" - the intersection of this component's visible rectangle, new Rectangle(0, 0, getWidth(), getHeight()), and all of its ancestors' visible rectangles.

Returns:
the visible rectangle

firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, boolean, boolean)

public void firePropertyChange(String sample code for java.lang.String definition code for java.lang.String  propertyName,
                               boolean oldValue,
                               boolean newValue)
Support for reporting bound property changes for boolean properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Overrides:
firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, boolean, boolean) definition code for java.awt.Component.firePropertyChange(java.lang.String, boolean, boolean) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
propertyName - the property whose value has changed
oldValue - the property's previous value
newValue - the property's new value

firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, int, int)

public void firePropertyChange(String sample code for java.lang.String definition code for java.lang.String  propertyName,
                               int oldValue,
                               int newValue)
Support for reporting bound property changes for integer properties. This method can be called when a bound property has changed and it will send the appropriate PropertyChangeEvent to any registered PropertyChangeListeners.

Overrides:
firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, int, int) definition code for java.awt.Component.firePropertyChange(java.lang.String, int, int) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
propertyName - the property whose value has changed
oldValue - the property's previous value
newValue - the property's new value

firePropertyChange sample code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char) definition code for javax.swing.JComponent.firePropertyChange(java.lang.String, char, char)

public void firePropertyChange(String sample code for java.lang.String definition code for java.lang.String  propertyName,
                               char oldValue,
                               char newValue)
Description copied from class: Component sample code for java.awt.Component.firePropertyChange(java.lang.String, char, char) definition code for java.awt.Component.firePropertyChange(java.lang.String, char, char)
Reports a bound property change.

Overrides:
firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, char, char) definition code for java.awt.Component.firePropertyChange(java.lang.String, char, char) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property (as a char)
newValue - the new value of the property (as a char)
See Also:
Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object)

fireVetoableChange sample code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for javax.swing.JComponent.fireVetoableChange(java.lang.String, java.lang.Object, java.lang.Object)

protected void fireVetoableChange(String sample code for java.lang.String definition code for java.lang.String  propertyName,
                                  Object sample code for java.lang.Object definition code for java.lang.Object  oldValue,
                                  Object sample code for java.lang.Object definition code for java.lang.Object  newValue)
                           throws PropertyVetoException sample code for java.beans.PropertyVetoException definition code for java.beans.PropertyVetoException 
Supports reporting constrained property changes. This method can be called when a constrained property has changed and it will send the appropriate PropertyChangeEvent to any registered VetoableChangeListeners.

Parameters:
propertyName - the name of the property that was listened on
oldValue - the old value of the property
newValue - the new value of the property
Throws:
PropertyVetoException sample code for java.beans.PropertyVetoException definition code for java.beans.PropertyVetoException - when the attempt to set the property is vetoed by the component

addVetoableChangeListener sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener)

public void addVetoableChangeListener(VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  listener)
Adds a VetoableChangeListener to the listener list. The listener is registered for all properties.

Parameters:
listener - the VetoableChangeListener to be added

removeVetoableChangeListener sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener)

public void removeVetoableChangeListener(VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener  listener)
Removes a VetoableChangeListener from the listener list. This removes a VetoableChangeListener that was registered for all properties.

Parameters:
listener - the VetoableChangeListener to be removed

getVetoableChangeListeners sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners()

public VetoableChangeListener sample code for java.beans.VetoableChangeListener definition code for java.beans.VetoableChangeListener [] getVetoableChangeListeners()
Returns an array of all the vetoable change listeners registered on this component.

Returns:
all of the component's VetoableChangeListeners or an empty array if no vetoable change listeners are currently registered
Since:
1.4
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener) sample code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.addVetoableChangeListener(java.beans.VetoableChangeListener) , removeVetoableChangeListener(java.beans.VetoableChangeListener) sample code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener) definition code for javax.swing.JComponent.removeVetoableChangeListener(java.beans.VetoableChangeListener)

getTopLevelAncestor sample code for javax.swing.JComponent.getTopLevelAncestor() definition code for javax.swing.JComponent.getTopLevelAncestor()

public Container sample code for java.awt.Container definition code for java.awt.Container  getTopLevelAncestor()
Returns the top-level ancestor of this component (either the containing Window or Applet), or null if this component has not been added to any container.

Returns:
the top-level Container that this component is in, or null if not in any container

addAncestorListener sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener)

public void addAncestorListener(AncestorListener sample code for javax.swing.event.AncestorListener definition code for javax.swing.event.AncestorListener  listener)
Registers listener so that it will receive AncestorEvents when it or any of its ancestors move or are made visible or invisible. Events are also sent when the component or its ancestors are added or removed from the containment hierarchy.

Parameters:
listener - the AncestorListener to register
See Also:
AncestorEvent sample code for javax.swing.event.AncestorEvent definition code for javax.swing.event.AncestorEvent

removeAncestorListener sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener)

public void removeAncestorListener(AncestorListener sample code for javax.swing.event.AncestorListener definition code for javax.swing.event.AncestorListener  listener)
Unregisters listener so that it will no longer receive AncestorEvents.

Parameters:
listener - the AncestorListener to be removed
See Also:
addAncestorListener(javax.swing.event.AncestorListener) sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener)

getAncestorListeners sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners()

public AncestorListener sample code for javax.swing.event.AncestorListener definition code for javax.swing.event.AncestorListener [] getAncestorListeners()
Returns an array of all the ancestor listeners registered on this component.

Returns:
all of the component's AncestorListeners or an empty array if no ancestor listeners are currently registered
Since:
1.4
See Also:
addAncestorListener(javax.swing.event.AncestorListener) sample code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.addAncestorListener(javax.swing.event.AncestorListener) , removeAncestorListener(javax.swing.event.AncestorListener) sample code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener) definition code for javax.swing.JComponent.removeAncestorListener(javax.swing.event.AncestorListener)

getListeners sample code for javax.swing.JComponent.<T extends java.util.EventListener>getListeners(java.lang.Class<T>) definition code for javax.swing.JComponent.<T extends java.util.EventListener>getListeners(java.lang.Class<T>)

public <T extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener > T[] getListeners(Class sample code for java.lang.Class definition code for java.lang.Class <T> listenerType)
Returns an array of all the objects currently registered as FooListeners upon this JComponent. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a JComponent c for its mouse listeners with the following code:

MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));
If no such listeners exist, this method returns an empty array.

Overrides:
getListeners sample code for java.awt.Container.getListeners(java.lang.Class) definition code for java.awt.Container.getListeners(java.lang.Class) in class Container sample code for java.awt.Container definition code for java.awt.Container
Parameters:
listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
Returns:
an array of all objects registered as FooListeners on this component, or an empty array if no such listeners have been added
Throws:
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
Since:
1.3
See Also:
getVetoableChangeListeners() sample code for javax.swing.JComponent.getVetoableChangeListeners() definition code for javax.swing.JComponent.getVetoableChangeListeners() , getAncestorListeners() sample code for javax.swing.JComponent.getAncestorListeners() definition code for javax.swing.JComponent.getAncestorListeners()

addNotify sample code for javax.swing.JComponent.addNotify() definition code for javax.swing.JComponent.addNotify()

public void addNotify()
Notifies this component that it now has a parent component. When this method is invoked, the chain of parent components is set up with KeyboardAction event listeners.

Overrides:
addNotify sample code for java.awt.Container.addNotify() definition code for java.awt.Container.addNotify() in class Container sample code for java.awt.Container definition code for java.awt.Container
See Also:
registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)

removeNotify sample code for javax.swing.JComponent.removeNotify() definition code for javax.swing.JComponent.removeNotify()

public void removeNotify()
Notifies this component that it no longer has a parent component. When this method is invoked, any KeyboardActions set up in the the chain of parent components are removed.

Overrides:
removeNotify sample code for java.awt.Container.removeNotify() definition code for java.awt.Container.removeNotify() in class Container sample code for java.awt.Container definition code for java.awt.Container
See Also:
registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) sample code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int) definition code for javax.swing.JComponent.registerKeyboardAction(java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int)

repaint sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int)

public void repaint(long tm,
                    int x,
                    int y,
                    int width,
                    int height)
Adds the specified region to the dirty region list if the component is showing. The component will be repainted after all of the currently pending events have been dispatched.

Overrides:
repaint sample code for java.awt.Component.repaint(long, int, int, int, int) definition code for java.awt.Component.repaint(long, int, int, int, int) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
tm - this parameter is not used
x - the x value of the dirty region
y - the y value of the dirty region
width - the width of the dirty region
height - the height of the dirty region
See Also:
Component.isShowing() sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int) sample code for javax.swing.RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int) definition code for javax.swing.RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)

repaint sample code for javax.swing.JComponent.repaint(java.awt.Rectangle) definition code for javax.swing.JComponent.repaint(java.awt.Rectangle)

public void repaint(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
Adds the specified region to the dirty region list if the component is showing. The component will be repainted after all of the currently pending events have been dispatched.

Parameters:
r - a Rectangle containing the dirty region
See Also:
Component.isShowing() sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int) sample code for javax.swing.RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int) definition code for javax.swing.RepaintManager.addDirtyRegion(javax.swing.JComponent, int, int, int, int)

revalidate sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate()

public void revalidate()
Supports deferred automatic layout.

Calls invalidate and then adds this component's validateRoot to a list of components that need to be validated. Validation will occur after all currently pending events have been dispatched. In other words after this method is called, the first validateRoot (if any) found when walking up the containment hierarchy of this component will be validated. By default, JRootPane, JScrollPane, and JTextField return true from isValidateRoot.

This method will automatically be called on this component when a property value changes such that size, location, or internal layout of this component has been affected. This automatic updating differs from the AWT because programs generally no longer need to invoke validate to get the contents of the GUI to update.

See Also:
Component.invalidate() sample code for java.awt.Component.invalidate() definition code for java.awt.Component.invalidate() , Container.validate() sample code for java.awt.Container.validate() definition code for java.awt.Container.validate() , isValidateRoot() sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot() , RepaintManager.addInvalidComponent(javax.swing.JComponent) sample code for javax.swing.RepaintManager.addInvalidComponent(javax.swing.JComponent) definition code for javax.swing.RepaintManager.addInvalidComponent(javax.swing.JComponent)

isValidateRoot sample code for javax.swing.JComponent.isValidateRoot() definition code for javax.swing.JComponent.isValidateRoot()

public boolean isValidateRoot()
If this method returns true, revalidate calls by descendants of this component will cause the entire tree beginning with this root to be validated. Returns false by default. JScrollPane overrides this method and returns true.

Returns:
always returns false
See Also:
revalidate() sample code for javax.swing.JComponent.revalidate() definition code for javax.swing.JComponent.revalidate() , Component.invalidate() sample code for java.awt.Component.invalidate() definition code for java.awt.Component.invalidate() , Container.validate() sample code for java.awt.Container.validate() definition code for java.awt.Container.validate()

isOptimizedDrawingEnabled sample code for javax.swing.JComponent.isOptimizedDrawingEnabled() definition code for javax.swing.JComponent.isOptimizedDrawingEnabled()

public boolean isOptimizedDrawingEnabled()
Returns true if this component tiles its children -- that is, if it can guarantee that the children will not overlap. The repainting system is substantially more efficient in this common case. JComponent subclasses that can't make this guarantee, such as JLayeredPane, should override this method to return false.

Returns:
always returns true

paintImmediately sample code for javax.swing.JComponent.paintImmediately(int, int, int, int) definition code for javax.swing.JComponent.paintImmediately(int, int, int, int)

public void paintImmediately(int x,
                             int y,
                             int w,
                             int h)
Paints the specified region in this component and all of its descendants that overlap the region, immediately.

It's rarely necessary to call this method. In most cases it's more efficient to call repaint, which defers the actual painting and can collapse redundant requests into a single paint call. This method is useful if one needs to update the display while the current event is being dispatched.

Parameters:
x - the x value of the region to be painted
y - the y value of the region to be painted
w - the width of the region to be painted
h - the height of the region to be painted
See Also:
repaint(long, int, int, int, int) sample code for javax.swing.JComponent.repaint(long, int, int, int, int) definition code for javax.swing.JComponent.repaint(long, int, int, int, int)

paintImmediately sample code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle) definition code for javax.swing.JComponent.paintImmediately(java.awt.Rectangle)

public void paintImmediately(Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  r)
Paints the specified region now.

Parameters:
r - a Rectangle containing the region to be painted

setDoubleBuffered sample code for javax.swing.JComponent.setDoubleBuffered(boolean) definition code for javax.swing.JComponent.setDoubleBuffered(boolean)

public void setDoubleBuffered(boolean aFlag)
Sets whether the this component should use a buffer to paint. If set to true, all the drawing from this component will be done in an offscreen painting buffer. The offscreen painting buffer will the be copied onto the screen. Swings painting system always uses a maximum of one double buffer. If a Component is buffered and one of its ancestor is also buffered, the ancestor buffer will be used.

Parameters:
aFlag - if true, set this component to be double buffered

isDoubleBuffered sample code for javax.swing.JComponent.isDoubleBuffered() definition code for javax.swing.JComponent.isDoubleBuffered()

public boolean isDoubleBuffered()
Returns whether this component should use a buffer to paint.

Overrides:
isDoubleBuffered sample code for java.awt.Component.isDoubleBuffered() definition code for java.awt.Component.isDoubleBuffered() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
true if this component is double buffered, otherwise false

getRootPane sample code for javax.swing.JComponent.getRootPane() definition code for javax.swing.JComponent.getRootPane()

public JRootPane sample code for javax.swing.JRootPane definition code for javax.swing.JRootPane  getRootPane()
Returns the JRootPane ancestor for this component.

Returns:
the JRootPane that contains this component, or null if no JRootPane is found

paramString sample code for javax.swing.JComponent.paramString() definition code for javax.swing.JComponent.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representation of this JComponent. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString sample code for java.awt.Container.paramString() definition code for java.awt.Container.paramString() in class Container sample code for java.awt.Container definition code for java.awt.Container
Returns:
a string representation of this JComponent