JComponent (Java Platform SE 8 ) (original) (raw)

Modifier and Type

Method

Description

void

[addAncestorListener](../../javax/swing/JComponent.html#addAncestorListener-javax.swing.event.AncestorListener-)([AncestorListener](../../javax/swing/event/AncestorListener.html "interface in javax.swing.event") listener)

Registers listener so that it will receiveAncestorEvents when it or any of its ancestors move or are made visible or invisible.

void

[addNotify](../../javax/swing/JComponent.html#addNotify--)()

Notifies this component that it now has a parent component.

void

[addVetoableChangeListener](../../javax/swing/JComponent.html#addVetoableChangeListener-java.beans.VetoableChangeListener-)([VetoableChangeListener](../../java/beans/VetoableChangeListener.html "interface in java.beans") listener)

Adds a VetoableChangeListener to the listener list.

void

[computeVisibleRect](../../javax/swing/JComponent.html#computeVisibleRect-java.awt.Rectangle-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") visibleRect)

Returns the Component's "visible rect rectangle" - the intersection of the visible rectangles for this component and all of its ancestors.

boolean

[contains](../../javax/swing/JComponent.html#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](../../javax/swing/JToolTip.html "class in javax.swing")

[createToolTip](../../javax/swing/JComponent.html#createToolTip--)()

Returns the instance of JToolTip that should be used to display the tooltip.

void

[disable](../../javax/swing/JComponent.html#disable--)()

void

[enable](../../javax/swing/JComponent.html#enable--)()

void

[firePropertyChange](../../javax/swing/JComponent.html#firePropertyChange-java.lang.String-boolean-boolean-)([String](../../java/lang/String.html "class in java.lang") propertyName, boolean oldValue, boolean newValue)

Support for reporting bound property changes for boolean properties.

void

[firePropertyChange](../../javax/swing/JComponent.html#firePropertyChange-java.lang.String-char-char-)([String](../../java/lang/String.html "class in java.lang") propertyName, char oldValue, char newValue)

Reports a bound property change.

void

[firePropertyChange](../../javax/swing/JComponent.html#firePropertyChange-java.lang.String-int-int-)([String](../../java/lang/String.html "class in java.lang") propertyName, int oldValue, int newValue)

Support for reporting bound property changes for integer properties.

protected void

[fireVetoableChange](../../javax/swing/JComponent.html#fireVetoableChange-java.lang.String-java.lang.Object-java.lang.Object-)([String](../../java/lang/String.html "class in java.lang") propertyName,[Object](../../java/lang/Object.html "class in java.lang") oldValue,[Object](../../java/lang/Object.html "class in java.lang") newValue)

Supports reporting constrained property changes.

[ActionListener](../../java/awt/event/ActionListener.html "interface in java.awt.event")

[getActionForKeyStroke](../../javax/swing/JComponent.html#getActionForKeyStroke-javax.swing.KeyStroke-)([KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing") aKeyStroke)

Returns the object that will perform the action registered for a given keystroke.

[ActionMap](../../javax/swing/ActionMap.html "class in javax.swing")

[getActionMap](../../javax/swing/JComponent.html#getActionMap--)()

Returns the ActionMap used to determine whatAction to fire for particular KeyStroke binding.

float

[getAlignmentX](../../javax/swing/JComponent.html#getAlignmentX--)()

Overrides Container.getAlignmentX to return the vertical alignment.

float

[getAlignmentY](../../javax/swing/JComponent.html#getAlignmentY--)()

Overrides Container.getAlignmentY to return the horizontal alignment.

[AncestorListener](../../javax/swing/event/AncestorListener.html "interface in javax.swing.event")[]

[getAncestorListeners](../../javax/swing/JComponent.html#getAncestorListeners--)()

Returns an array of all the ancestor listeners registered on this component.

boolean

[getAutoscrolls](../../javax/swing/JComponent.html#getAutoscrolls--)()

Gets the autoscrolls property.

int

[getBaseline](../../javax/swing/JComponent.html#getBaseline-int-int-)(int width, int height)

Returns the baseline.

[Component.BaselineResizeBehavior](../../java/awt/Component.BaselineResizeBehavior.html "enum in java.awt")

[getBaselineResizeBehavior](../../javax/swing/JComponent.html#getBaselineResizeBehavior--)()

Returns an enum indicating how the baseline of the component changes as the size changes.

[Border](../../javax/swing/border/Border.html "interface in javax.swing.border")

[getBorder](../../javax/swing/JComponent.html#getBorder--)()

Returns the border of this component or null if no border is currently set.

[Rectangle](../../java/awt/Rectangle.html "class in java.awt")

[getBounds](../../javax/swing/JComponent.html#getBounds-java.awt.Rectangle-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") rv)

Stores the bounds of this component into "return value"rv and returns rv.

[Object](../../java/lang/Object.html "class in java.lang")

[getClientProperty](../../javax/swing/JComponent.html#getClientProperty-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") key)

Returns the value of the property with the specified key.

protected [Graphics](../../java/awt/Graphics.html "class in java.awt")

[getComponentGraphics](../../javax/swing/JComponent.html#getComponentGraphics-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Returns the graphics object used to paint this component.

[JPopupMenu](../../javax/swing/JPopupMenu.html "class in javax.swing")

[getComponentPopupMenu](../../javax/swing/JComponent.html#getComponentPopupMenu--)()

Returns JPopupMenu that assigned for this component.

int

[getConditionForKeyStroke](../../javax/swing/JComponent.html#getConditionForKeyStroke-javax.swing.KeyStroke-)([KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing") aKeyStroke)

Returns the condition that determines whether a registered action occurs in response to the specified keystroke.

int

[getDebugGraphicsOptions](../../javax/swing/JComponent.html#getDebugGraphicsOptions--)()

Returns the state of graphics debugging.

static [Locale](../../java/util/Locale.html "class in java.util")

[getDefaultLocale](../../javax/swing/JComponent.html#getDefaultLocale--)()

Returns the default locale used to initialize each JComponent's locale property upon creation.

[FontMetrics](../../java/awt/FontMetrics.html "class in java.awt")

[getFontMetrics](../../javax/swing/JComponent.html#getFontMetrics-java.awt.Font-)([Font](../../java/awt/Font.html "class in java.awt") font)

Gets the FontMetrics for the specified Font.

[Graphics](../../java/awt/Graphics.html "class in java.awt")

[getGraphics](../../javax/swing/JComponent.html#getGraphics--)()

Returns this component's graphics context, which lets you draw on a component.

int

[getHeight](../../javax/swing/JComponent.html#getHeight--)()

Returns the current height of this component.

boolean

[getInheritsPopupMenu](../../javax/swing/JComponent.html#getInheritsPopupMenu--)()

Returns true if the JPopupMenu should be inherited from the parent.

[InputMap](../../javax/swing/InputMap.html "class in javax.swing")

[getInputMap](../../javax/swing/JComponent.html#getInputMap--)()

Returns the InputMap that is used when the component has focus.

[InputMap](../../javax/swing/InputMap.html "class in javax.swing")

[getInputMap](../../javax/swing/JComponent.html#getInputMap-int-)(int condition)

Returns the InputMap that is used duringcondition.

[InputVerifier](../../javax/swing/InputVerifier.html "class in javax.swing")

[getInputVerifier](../../javax/swing/JComponent.html#getInputVerifier--)()

Returns the input verifier for this component.

[Insets](../../java/awt/Insets.html "class in java.awt")

[getInsets](../../javax/swing/JComponent.html#getInsets--)()

If a border has been set on this component, returns the border's insets; otherwise calls super.getInsets.

[Insets](../../java/awt/Insets.html "class in java.awt")

[getInsets](../../javax/swing/JComponent.html#getInsets-java.awt.Insets-)([Insets](../../java/awt/Insets.html "class in java.awt") insets)

Returns an Insets object containing this component's inset values.

<T extends [EventListener](../../java/util/EventListener.html "interface in java.util")> T[]

[getListeners](../../javax/swing/JComponent.html#getListeners-java.lang.Class-)([Class](../../java/lang/Class.html "class in java.lang")<T> listenerType)

Returns an array of all the objects currently registered as _Foo_Listeners upon this JComponent.

[Point](../../java/awt/Point.html "class in java.awt")

[getLocation](../../javax/swing/JComponent.html#getLocation-java.awt.Point-)([Point](../../java/awt/Point.html "class in java.awt") rv)

Stores the x,y origin of this component into "return value"rv and returns rv.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

[getMaximumSize](../../javax/swing/JComponent.html#getMaximumSize--)()

If the maximum size has been set to a non-null value just returns it.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

[getMinimumSize](../../javax/swing/JComponent.html#getMinimumSize--)()

If the minimum size has been set to a non-null value just returns it.

[Component](../../java/awt/Component.html "class in java.awt")

[getNextFocusableComponent](../../javax/swing/JComponent.html#getNextFocusableComponent--)()

[Point](../../java/awt/Point.html "class in java.awt")

[getPopupLocation](../../javax/swing/JComponent.html#getPopupLocation-java.awt.event.MouseEvent-)([MouseEvent](../../java/awt/event/MouseEvent.html "class in java.awt.event") event)

Returns the preferred location to display the popup menu in this component's coordinate system.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

[getPreferredSize](../../javax/swing/JComponent.html#getPreferredSize--)()

If the preferredSize has been set to a non-null value just returns it.

[KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing")[]

[getRegisteredKeyStrokes](../../javax/swing/JComponent.html#getRegisteredKeyStrokes--)()

Returns the KeyStrokes that will initiate registered actions.

[JRootPane](../../javax/swing/JRootPane.html "class in javax.swing")

[getRootPane](../../javax/swing/JComponent.html#getRootPane--)()

Returns the JRootPane ancestor for this component.

[Dimension](../../java/awt/Dimension.html "class in java.awt")

[getSize](../../javax/swing/JComponent.html#getSize-java.awt.Dimension-)([Dimension](../../java/awt/Dimension.html "class in java.awt") rv)

Stores the width/height of this component into "return value"rv and returns rv.

[Point](../../java/awt/Point.html "class in java.awt")

[getToolTipLocation](../../javax/swing/JComponent.html#getToolTipLocation-java.awt.event.MouseEvent-)([MouseEvent](../../java/awt/event/MouseEvent.html "class in java.awt.event") event)

Returns the tooltip location in this component's coordinate system.

[String](../../java/lang/String.html "class in java.lang")

[getToolTipText](../../javax/swing/JComponent.html#getToolTipText--)()

Returns the tooltip string that has been set withsetToolTipText.

[String](../../java/lang/String.html "class in java.lang")

[getToolTipText](../../javax/swing/JComponent.html#getToolTipText-java.awt.event.MouseEvent-)([MouseEvent](../../java/awt/event/MouseEvent.html "class in java.awt.event") event)

Returns the string to be used as the tooltip for event.

[Container](../../java/awt/Container.html "class in java.awt")

[getTopLevelAncestor](../../javax/swing/JComponent.html#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](../../javax/swing/TransferHandler.html "class in javax.swing")

[getTransferHandler](../../javax/swing/JComponent.html#getTransferHandler--)()

Gets the transferHandler property.

[String](../../java/lang/String.html "class in java.lang")

[getUIClassID](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#getVerifyInputWhenFocusTarget--)()

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

[VetoableChangeListener](../../java/beans/VetoableChangeListener.html "interface in java.beans")[]

[getVetoableChangeListeners](../../javax/swing/JComponent.html#getVetoableChangeListeners--)()

Returns an array of all the vetoable change listeners registered on this component.

[Rectangle](../../java/awt/Rectangle.html "class in java.awt")

[getVisibleRect](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#getWidth--)()

Returns the current width of this component.

int

[getX](../../javax/swing/JComponent.html#getX--)()

Returns the current x coordinate of the component's origin.

int

[getY](../../javax/swing/JComponent.html#getY--)()

Returns the current y coordinate of the component's origin.

void

[grabFocus](../../javax/swing/JComponent.html#grabFocus--)()

Requests that this Component get the input focus, and that this Component's top-level ancestor become the focused Window.

void

[hide](../../javax/swing/JComponent.html#hide--)()

Deprecated.

boolean

[isDoubleBuffered](../../javax/swing/JComponent.html#isDoubleBuffered--)()

Returns whether this component should use a buffer to paint.

static boolean

[isLightweightComponent](../../javax/swing/JComponent.html#isLightweightComponent-java.awt.Component-)([Component](../../java/awt/Component.html "class in java.awt") c)

Returns true if this component is lightweight, that is, if it doesn't have a native window system peer.

boolean

[isManagingFocus](../../javax/swing/JComponent.html#isManagingFocus--)()

boolean

[isOpaque](../../javax/swing/JComponent.html#isOpaque--)()

Returns true if this component is completely opaque.

boolean

[isOptimizedDrawingEnabled](../../javax/swing/JComponent.html#isOptimizedDrawingEnabled--)()

Returns true if this component tiles its children -- that is, if it can guarantee that the children will not overlap.

boolean

[isPaintingForPrint](../../javax/swing/JComponent.html#isPaintingForPrint--)()

Returns true if the current painting operation on this component is part of a print operation.

protected boolean

[isPaintingOrigin](../../javax/swing/JComponent.html#isPaintingOrigin--)()

Returns true if a paint triggered on a child component should cause painting to originate from this Component, or one of its ancestors.

boolean

[isPaintingTile](../../javax/swing/JComponent.html#isPaintingTile--)()

Returns true if the component is currently painting a tile.

boolean

[isRequestFocusEnabled](../../javax/swing/JComponent.html#isRequestFocusEnabled--)()

Returns true if this JComponent should get focus; otherwise returns false.

boolean

[isValidateRoot](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#paint-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Invoked by Swing to draw components.

protected void

[paintBorder](../../javax/swing/JComponent.html#paintBorder-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Paints the component's border.

protected void

[paintChildren](../../javax/swing/JComponent.html#paintChildren-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Paints this component's children.

protected void

[paintComponent](../../javax/swing/JComponent.html#paintComponent-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Calls the UI delegate's paint method, if the UI delegate is non-null.

void

[paintImmediately](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#paintImmediately-java.awt.Rectangle-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") r)

Paints the specified region now.

protected [String](../../java/lang/String.html "class in java.lang")

[paramString](../../javax/swing/JComponent.html#paramString--)()

Returns a string representation of this JComponent.

void

[print](../../javax/swing/JComponent.html#print-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Invoke this method to print the component to the specifiedGraphics.

void

[printAll](../../javax/swing/JComponent.html#printAll-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Invoke this method to print the component.

protected void

[printBorder](../../javax/swing/JComponent.html#printBorder-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Prints the component's border.

protected void

[printChildren](../../javax/swing/JComponent.html#printChildren-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Prints this component's children.

protected void

[printComponent](../../javax/swing/JComponent.html#printComponent-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

This is invoked during a printing operation.

protected void

[processComponentKeyEvent](../../javax/swing/JComponent.html#processComponentKeyEvent-java.awt.event.KeyEvent-)([KeyEvent](../../java/awt/event/KeyEvent.html "class in java.awt.event") e)

Processes any key events that the component itself recognizes.

protected boolean

[processKeyBinding](../../javax/swing/JComponent.html#processKeyBinding-javax.swing.KeyStroke-java.awt.event.KeyEvent-int-boolean-)([KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing") ks,[KeyEvent](../../java/awt/event/KeyEvent.html "class in java.awt.event") e, int condition, boolean pressed)

Invoked to process the key bindings for ks as the result of the KeyEvent e.

protected void

[processKeyEvent](../../javax/swing/JComponent.html#processKeyEvent-java.awt.event.KeyEvent-)([KeyEvent](../../java/awt/event/KeyEvent.html "class in java.awt.event") e)

Overrides processKeyEvent to process events.

protected void

[processMouseEvent](../../javax/swing/JComponent.html#processMouseEvent-java.awt.event.MouseEvent-)([MouseEvent](../../java/awt/event/MouseEvent.html "class in java.awt.event") e)

Processes mouse events occurring on this component by dispatching them to any registeredMouseListener objects, refer toComponent.processMouseEvent(MouseEvent) for a complete description of this method.

protected void

[processMouseMotionEvent](../../javax/swing/JComponent.html#processMouseMotionEvent-java.awt.event.MouseEvent-)([MouseEvent](../../java/awt/event/MouseEvent.html "class in java.awt.event") e)

Processes mouse motion events, such as MouseEvent.MOUSE_DRAGGED.

void

[putClientProperty](../../javax/swing/JComponent.html#putClientProperty-java.lang.Object-java.lang.Object-)([Object](../../java/lang/Object.html "class in java.lang") key,[Object](../../java/lang/Object.html "class in java.lang") value)

Adds an arbitrary key/value "client property" to this component.

void

[registerKeyboardAction](../../javax/swing/JComponent.html#registerKeyboardAction-java.awt.event.ActionListener-javax.swing.KeyStroke-int-)([ActionListener](../../java/awt/event/ActionListener.html "interface in java.awt.event") anAction,[KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing") aKeyStroke, int aCondition)

This method is now obsolete, please use a combination ofgetActionMap() and getInputMap() for similar behavior.

void

[registerKeyboardAction](../../javax/swing/JComponent.html#registerKeyboardAction-java.awt.event.ActionListener-java.lang.String-javax.swing.KeyStroke-int-)([ActionListener](../../java/awt/event/ActionListener.html "interface in java.awt.event") anAction,[String](../../java/lang/String.html "class in java.lang") aCommand,[KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing") aKeyStroke, int aCondition)

This method is now obsolete, please use a combination ofgetActionMap() and getInputMap() for similar behavior.

void

[removeAncestorListener](../../javax/swing/JComponent.html#removeAncestorListener-javax.swing.event.AncestorListener-)([AncestorListener](../../javax/swing/event/AncestorListener.html "interface in javax.swing.event") listener)

Unregisters listener so that it will no longer receiveAncestorEvents.

void

[removeNotify](../../javax/swing/JComponent.html#removeNotify--)()

Notifies this component that it no longer has a parent component.

void

[removeVetoableChangeListener](../../javax/swing/JComponent.html#removeVetoableChangeListener-java.beans.VetoableChangeListener-)([VetoableChangeListener](../../java/beans/VetoableChangeListener.html "interface in java.beans") listener)

Removes a VetoableChangeListener from the listener list.

void

[repaint](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#repaint-java.awt.Rectangle-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") r)

Adds the specified region to the dirty region list if the component is showing.

boolean

[requestDefaultFocus](../../javax/swing/JComponent.html#requestDefaultFocus--)()

void

[requestFocus](../../javax/swing/JComponent.html#requestFocus--)()

Requests that this Component gets the input focus.

boolean

[requestFocus](../../javax/swing/JComponent.html#requestFocus-boolean-)(boolean temporary)

Requests that this Component gets the input focus.

boolean

[requestFocusInWindow](../../javax/swing/JComponent.html#requestFocusInWindow--)()

Requests that this Component gets the input focus.

protected boolean

[requestFocusInWindow](../../javax/swing/JComponent.html#requestFocusInWindow-boolean-)(boolean temporary)

Requests that this Component gets the input focus.

void

[resetKeyboardActions](../../javax/swing/JComponent.html#resetKeyboardActions--)()

Unregisters all the bindings in the first tier InputMaps and ActionMap.

void

[reshape](../../javax/swing/JComponent.html#reshape-int-int-int-int-)(int x, int y, int w, int h)

void

[revalidate](../../javax/swing/JComponent.html#revalidate--)()

Supports deferred automatic layout.

void

[scrollRectToVisible](../../javax/swing/JComponent.html#scrollRectToVisible-java.awt.Rectangle-)([Rectangle](../../java/awt/Rectangle.html "class in java.awt") aRect)

Forwards the scrollRectToVisible() message to theJComponent's parent.

void

[setActionMap](../../javax/swing/JComponent.html#setActionMap-javax.swing.ActionMap-)([ActionMap](../../javax/swing/ActionMap.html "class in javax.swing") am)

Sets the ActionMap to am.

void

[setAlignmentX](../../javax/swing/JComponent.html#setAlignmentX-float-)(float alignmentX)

Sets the the vertical alignment.

void

[setAlignmentY](../../javax/swing/JComponent.html#setAlignmentY-float-)(float alignmentY)

Sets the the horizontal alignment.

void

[setAutoscrolls](../../javax/swing/JComponent.html#setAutoscrolls-boolean-)(boolean autoscrolls)

Sets the autoscrolls property.

void

[setBackground](../../javax/swing/JComponent.html#setBackground-java.awt.Color-)([Color](../../java/awt/Color.html "class in java.awt") bg)

Sets the background color of this component.

void

[setBorder](../../javax/swing/JComponent.html#setBorder-javax.swing.border.Border-)([Border](../../javax/swing/border/Border.html "interface in javax.swing.border") border)

Sets the border of this component.

void

[setComponentPopupMenu](../../javax/swing/JComponent.html#setComponentPopupMenu-javax.swing.JPopupMenu-)([JPopupMenu](../../javax/swing/JPopupMenu.html "class in javax.swing") popup)

Sets the JPopupMenu for this JComponent.

void

[setDebugGraphicsOptions](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#setDefaultLocale-java.util.Locale-)([Locale](../../java/util/Locale.html "class in java.util") l)

Sets the default locale used to initialize each JComponent's locale property upon creation.

void

[setDoubleBuffered](../../javax/swing/JComponent.html#setDoubleBuffered-boolean-)(boolean aFlag)

Sets whether this component should use a buffer to paint.

void

[setEnabled](../../javax/swing/JComponent.html#setEnabled-boolean-)(boolean enabled)

Sets whether or not this component is enabled.

void

[setFocusTraversalKeys](../../javax/swing/JComponent.html#setFocusTraversalKeys-int-java.util.Set-)(int id,[Set](../../java/util/Set.html "interface in java.util")<? extends [AWTKeyStroke](../../java/awt/AWTKeyStroke.html "class in java.awt")> keystrokes)

Sets the focus traversal keys for a given traversal operation for this Component.

void

[setFont](../../javax/swing/JComponent.html#setFont-java.awt.Font-)([Font](../../java/awt/Font.html "class in java.awt") font)

Sets the font for this component.

void

[setForeground](../../javax/swing/JComponent.html#setForeground-java.awt.Color-)([Color](../../java/awt/Color.html "class in java.awt") fg)

Sets the foreground color of this component.

void

[setInheritsPopupMenu](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#setInputMap-int-javax.swing.InputMap-)(int condition,[InputMap](../../javax/swing/InputMap.html "class in javax.swing") map)

Sets the InputMap to use under the conditioncondition tomap.

void

[setInputVerifier](../../javax/swing/JComponent.html#setInputVerifier-javax.swing.InputVerifier-)([InputVerifier](../../javax/swing/InputVerifier.html "class in javax.swing") inputVerifier)

Sets the input verifier for this component.

void

[setMaximumSize](../../javax/swing/JComponent.html#setMaximumSize-java.awt.Dimension-)([Dimension](../../java/awt/Dimension.html "class in java.awt") maximumSize)

Sets the maximum size of this component to a constant value.

void

[setMinimumSize](../../javax/swing/JComponent.html#setMinimumSize-java.awt.Dimension-)([Dimension](../../java/awt/Dimension.html "class in java.awt") minimumSize)

Sets the minimum size of this component to a constant value.

void

[setNextFocusableComponent](../../javax/swing/JComponent.html#setNextFocusableComponent-java.awt.Component-)([Component](../../java/awt/Component.html "class in java.awt") aComponent)

void

[setOpaque](../../javax/swing/JComponent.html#setOpaque-boolean-)(boolean isOpaque)

If true the component paints every pixel within its bounds.

void

[setPreferredSize](../../javax/swing/JComponent.html#setPreferredSize-java.awt.Dimension-)([Dimension](../../java/awt/Dimension.html "class in java.awt") preferredSize)

Sets the preferred size of this component.

void

[setRequestFocusEnabled](../../javax/swing/JComponent.html#setRequestFocusEnabled-boolean-)(boolean requestFocusEnabled)

Provides a hint as to whether or not this JComponent should get focus.

void

[setToolTipText](../../javax/swing/JComponent.html#setToolTipText-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") text)

Registers the text to display in a tool tip.

void

[setTransferHandler](../../javax/swing/JComponent.html#setTransferHandler-javax.swing.TransferHandler-)([TransferHandler](../../javax/swing/TransferHandler.html "class in javax.swing") newHandler)

Sets the TransferHandler, which provides support for transfer of data into and out of this component via cut/copy/paste and drag and drop.

protected void

[setUI](../../javax/swing/JComponent.html#setUI-javax.swing.plaf.ComponentUI-)([ComponentUI](../../javax/swing/plaf/ComponentUI.html "class in javax.swing.plaf") newUI)

Sets the look and feel delegate for this component.

void

[setVerifyInputWhenFocusTarget](../../javax/swing/JComponent.html#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](../../javax/swing/JComponent.html#setVisible-boolean-)(boolean aFlag)

Makes the component visible or invisible.

void

[unregisterKeyboardAction](../../javax/swing/JComponent.html#unregisterKeyboardAction-javax.swing.KeyStroke-)([KeyStroke](../../javax/swing/KeyStroke.html "class in javax.swing") aKeyStroke)

This method is now obsolete.

void

[update](../../javax/swing/JComponent.html#update-java.awt.Graphics-)([Graphics](../../java/awt/Graphics.html "class in java.awt") g)

Calls paint.

void

[updateUI](../../javax/swing/JComponent.html#updateUI--)()

Resets the UI property to a value from the current look and feel.