JColorChooser (Java 2 Platform SE 5.0) (original) (raw)


javax.swing

Class JColorChooser

java.lang.Object extended by java.awt.Component extended by java.awt.Container extended by javax.swing.JComponent extended by javax.swing.JColorChooser

All Implemented Interfaces:

ImageObserver, MenuContainer, Serializable, Accessible


public class JColorChooser

extends JComponent

implements Accessible

JColorChooser provides a pane of controls designed to allow a user to manipulate and select a color. For information about using color choosers, seeHow to Use Color Choosers, a section in The Java Tutorial.

This class provides three levels of API:

  1. A static convenience method which shows a modal color-chooser dialog and returns the color selected by the user.
  2. A static convenience method for creating a color-chooser dialog where ActionListeners can be specified to be invoked when the user presses one of the dialog buttons.
  3. The ability to create instances of JColorChooser panes directly (within any container). PropertyChange listeners can be added to detect when the current "color" property changes.

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.


Nested Class Summary
protected class JColorChooser.AccessibleJColorChooser This class implements accessibility support for the JColorChooser class.
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
Field Summary
protected AccessibleContext accessibleContext
static String CHOOSER_PANELS_PROPERTY The chooserPanel array property name.
static String PREVIEW_PANEL_PROPERTY The preview panel property name.
static String SELECTION_MODEL_PROPERTY The selection model property name.
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor Summary
JColorChooser() Creates a color chooser pane with an initial color of white.
JColorChooser(Color initialColor) Creates a color chooser pane with the specified initial color.
JColorChooser(ColorSelectionModel model) Creates a color chooser pane with the specifiedColorSelectionModel.
Method Summary
void addChooserPanel(AbstractColorChooserPanel panel) Adds a color chooser panel to the color chooser.
static JDialog [createDialog](../../javax/swing/JColorChooser.html#createDialog%28java.awt.Component, java.lang.String, boolean, javax.swing.JColorChooser, java.awt.event.ActionListener, java.awt.event.ActionListener%29)(Component c,String title, boolean modal,JColorChooser chooserPane,ActionListener okListener,ActionListener cancelListener) Creates and returns a new dialog containing the specifiedColorChooser pane along with "OK", "Cancel", and "Reset" buttons.
AccessibleContext getAccessibleContext() Gets the AccessibleContext associated with this JColorChooser.
AbstractColorChooserPanel[] getChooserPanels() Returns the specified color panels.
Color getColor() Gets the current color value from the color chooser.
boolean getDragEnabled() Gets the value of the dragEnabled property.
JComponent getPreviewPanel() Returns the preview panel that shows a chosen color.
ColorSelectionModel getSelectionModel() Returns the data model that handles color selections.
ColorChooserUI getUI() Returns the L&F object that renders this component.
String getUIClassID() Returns the name of the L&F class that renders this component.
protected String paramString() Returns a string representation of this JColorChooser.
AbstractColorChooserPanel removeChooserPanel(AbstractColorChooserPanel panel) Removes the Color Panel specified.
void setChooserPanels(AbstractColorChooserPanel[] panels) Specifies the Color Panels used to choose a color value.
void setColor(Color color) Sets the current color of the color chooser to the specified color.
void setColor(int c) Sets the current color of the color chooser to the specified color.
void [setColor](../../javax/swing/JColorChooser.html#setColor%28int, int, int%29)(int r, int g, int b) Sets the current color of the color chooser to the specified RGB color.
void setDragEnabled(boolean b) Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component.
void setPreviewPanel(JComponent preview) Sets the current preview panel.
void setSelectionModel(ColorSelectionModel newModel) Sets the model containing the selected color.
void setUI(ColorChooserUI ui) Sets the L&F object that renders this component.
static Color [showDialog](../../javax/swing/JColorChooser.html#showDialog%28java.awt.Component, java.lang.String, java.awt.Color%29)(Component component,String title,Color initialColor) Shows a modal color-chooser dialog and blocks until the dialog is hidden.
void updateUI() Notification from the UIManager that the L&F has changed.
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, [contains](../../javax/swing/JComponent.html#contains%28int, int%29), createToolTip, disable, enable, [firePropertyChange](../../javax/swing/JComponent.html#firePropertyChange%28java.lang.String, boolean, boolean%29), [firePropertyChange](../../javax/swing/JComponent.html#firePropertyChange%28java.lang.String, char, char%29), [firePropertyChange](../../javax/swing/JComponent.html#firePropertyChange%28java.lang.String, int, int%29), [fireVetoableChange](../../javax/swing/JComponent.html#fireVetoableChange%28java.lang.String, java.lang.Object, java.lang.Object%29), getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, [paintImmediately](../../javax/swing/JComponent.html#paintImmediately%28int, int, int, int%29), paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, [processKeyBinding](../../javax/swing/JComponent.html#processKeyBinding%28javax.swing.KeyStroke, java.awt.event.KeyEvent, int, boolean%29), processKeyEvent, processMouseEvent, processMouseMotionEvent, [putClientProperty](../../javax/swing/JComponent.html#putClientProperty%28java.lang.Object, java.lang.Object%29), [registerKeyboardAction](../../javax/swing/JComponent.html#registerKeyboardAction%28java.awt.event.ActionListener, javax.swing.KeyStroke, int%29), [registerKeyboardAction](../../javax/swing/JComponent.html#registerKeyboardAction%28java.awt.event.ActionListener, java.lang.String, javax.swing.KeyStroke, int%29), removeAncestorListener, removeNotify, removeVetoableChangeListener, [repaint](../../javax/swing/JComponent.html#repaint%28long, int, int, int, int%29), repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, [reshape](../../javax/swing/JComponent.html#reshape%28int, int, int, int%29), revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, [setFocusTraversalKeys](../../javax/swing/JComponent.html#setFocusTraversalKeys%28int, java.util.Set%29), setFont, setForeground, setInheritsPopupMenu, [setInputMap](../../javax/swing/JComponent.html#setInputMap%28int, javax.swing.InputMap%29), setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, [add](../../java/awt/Container.html#add%28java.awt.Component, int%29), [add](../../java/awt/Container.html#add%28java.awt.Component, java.lang.Object%29), [add](../../java/awt/Container.html#add%28java.awt.Component, java.lang.Object, int%29), [add](../../java/awt/Container.html#add%28java.lang.String, java.awt.Component%29), addContainerListener, [addImpl](../../java/awt/Container.html#addImpl%28java.awt.Component, java.lang.Object, int%29), addPropertyChangeListener, [addPropertyChangeListener](../../java/awt/Container.html#addPropertyChangeListener%28java.lang.String, java.beans.PropertyChangeListener%29), applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, [findComponentAt](../../java/awt/Container.html#findComponentAt%28int, int%29), findComponentAt, getComponent, [getComponentAt](../../java/awt/Container.html#getComponentAt%28int, int%29), getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, [list](../../java/awt/Container.html#list%28java.io.PrintStream, int%29), [list](../../java/awt/Container.html#list%28java.io.PrintWriter, int%29), [locate](../../java/awt/Container.html#locate%28int, int%29), minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, [setComponentZOrder](../../java/awt/Container.html#setComponentZOrder%28java.awt.Component, int%29), setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
[action](../../java/awt/Component.html#action%28java.awt.Event, java.lang.Object%29), add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, [checkImage](../../java/awt/Component.html#checkImage%28java.awt.Image, java.awt.image.ImageObserver%29), [checkImage](../../java/awt/Component.html#checkImage%28java.awt.Image, int, int, java.awt.image.ImageObserver%29), [coalesceEvents](../../java/awt/Component.html#coalesceEvents%28java.awt.AWTEvent, java.awt.AWTEvent%29), contains, createImage, [createImage](../../java/awt/Component.html#createImage%28int, int%29), [createVolatileImage](../../java/awt/Component.html#createVolatileImage%28int, int%29), [createVolatileImage](../../java/awt/Component.html#createVolatileImage%28int, int, java.awt.ImageCapabilities%29), disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String, byte, byte%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String, double, double%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String, float, float%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String, long, long%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String, java.lang.Object, java.lang.Object%29), [firePropertyChange](../../java/awt/Component.html#firePropertyChange%28java.lang.String, short, short%29), getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, [gotFocus](../../java/awt/Component.html#gotFocus%28java.awt.Event, java.lang.Object%29), handleEvent, hasFocus, hide, [imageUpdate](../../java/awt/Component.html#imageUpdate%28java.awt.Image, int, int, int, int, int%29), [inside](../../java/awt/Component.html#inside%28int, int%29), isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, [keyDown](../../java/awt/Component.html#keyDown%28java.awt.Event, int%29), [keyUp](../../java/awt/Component.html#keyUp%28java.awt.Event, int%29), list, list, list, location, [lostFocus](../../java/awt/Component.html#lostFocus%28java.awt.Event, java.lang.Object%29), [mouseDown](../../java/awt/Component.html#mouseDown%28java.awt.Event, int, int%29), [mouseDrag](../../java/awt/Component.html#mouseDrag%28java.awt.Event, int, int%29), [mouseEnter](../../java/awt/Component.html#mouseEnter%28java.awt.Event, int, int%29), [mouseExit](../../java/awt/Component.html#mouseExit%28java.awt.Event, int, int%29), [mouseMove](../../java/awt/Component.html#mouseMove%28java.awt.Event, int, int%29), [mouseUp](../../java/awt/Component.html#mouseUp%28java.awt.Event, int, int%29), [move](../../java/awt/Component.html#move%28int, int%29), nextFocus, paintAll, postEvent, [prepareImage](../../java/awt/Component.html#prepareImage%28java.awt.Image, java.awt.image.ImageObserver%29), [prepareImage](../../java/awt/Component.html#prepareImage%28java.awt.Image, int, int, java.awt.image.ImageObserver%29), processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, [removePropertyChangeListener](../../java/awt/Component.html#removePropertyChangeListener%28java.lang.String, java.beans.PropertyChangeListener%29), repaint, [repaint](../../java/awt/Component.html#repaint%28int, int, int, int%29), repaint, resize, [resize](../../java/awt/Component.html#resize%28int, int%29), [setBounds](../../java/awt/Component.html#setBounds%28int, int, int, int%29), setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, [setLocation](../../java/awt/Component.html#setLocation%28int, int%29), setLocation, setName, setSize, [setSize](../../java/awt/Component.html#setSize%28int, int%29), show, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, [wait](../../java/lang/Object.html#wait%28long, int%29)
Field Detail

SELECTION_MODEL_PROPERTY

public static final String SELECTION_MODEL_PROPERTY

The selection model property name.

See Also:

Constant Field Values


PREVIEW_PANEL_PROPERTY

public static final String PREVIEW_PANEL_PROPERTY

The preview panel property name.

See Also:

Constant Field Values


CHOOSER_PANELS_PROPERTY

public static final String CHOOSER_PANELS_PROPERTY

The chooserPanel array property name.

See Also:

Constant Field Values


accessibleContext

protected AccessibleContext accessibleContext

Constructor Detail

JColorChooser

public JColorChooser()

Creates a color chooser pane with an initial color of white.


JColorChooser

public JColorChooser(Color initialColor)

Creates a color chooser pane with the specified initial color.

Parameters:

initialColor - the initial color set in the chooser


JColorChooser

public JColorChooser(ColorSelectionModel model)

Creates a color chooser pane with the specifiedColorSelectionModel.

Parameters:

model - the ColorSelectionModel to be used

Method Detail

showDialog

public static Color showDialog(Component component, String title, Color initialColor) throws HeadlessException

Shows a modal color-chooser dialog and blocks until the dialog is hidden. If the user presses the "OK" button, then this method hides/disposes the dialog and returns the selected color. If the user presses the "Cancel" button or closes the dialog without pressing "OK", then this method hides/disposes the dialog and returnsnull.

Parameters:

component - the parent Component for the dialog

title - the String containing the dialog's title

initialColor - the initial Color set when the color-chooser is shown

Returns:

the selected color or null if the user opted out

Throws:

[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt") - if GraphicsEnvironment.isHeadless() returns true.

See Also:

GraphicsEnvironment.isHeadless()


createDialog

public static JDialog createDialog(Component c, String title, boolean modal, JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener) throws HeadlessException

Creates and returns a new dialog containing the specifiedColorChooser pane along with "OK", "Cancel", and "Reset" buttons. If the "OK" or "Cancel" buttons are pressed, the dialog is automatically hidden (but not disposed). If the "Reset" button is pressed, the color-chooser's color will be reset to the color which was set the last time show was invoked on the dialog and the dialog will remain showing.

Parameters:

c - the parent component for the dialog

title - the title for the dialog

modal - a boolean. When true, the remainder of the program is inactive until the dialog is closed.

chooserPane - the color-chooser to be placed inside the dialog

okListener - the ActionListener invoked when "OK" is pressed

cancelListener - the ActionListener invoked when "Cancel" is pressed

Returns:

a new dialog containing the color-chooser pane

Throws:

[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt") - if GraphicsEnvironment.isHeadless() returns true.

See Also:

GraphicsEnvironment.isHeadless()


getUI

public ColorChooserUI getUI()

Returns the L&F object that renders this component.

Returns:

the ColorChooserUI object that renders this component


setUI

public void setUI(ColorChooserUI ui)

Sets the L&F object that renders this component.

Parameters:

ui - the ColorChooserUI L&F object

See Also:

UIDefaults.getUI(javax.swing.JComponent)


updateUI

public void updateUI()

Notification from the UIManager that the L&F has changed. Replaces the current UI object with the latest version from theUIManager.

Overrides:

[updateUI](../../javax/swing/JComponent.html#updateUI%28%29) in class [JComponent](../../javax/swing/JComponent.html "class in javax.swing")

See Also:

JComponent.updateUI()


getUIClassID

public String getUIClassID()

Returns the name of the L&F class that renders this component.

Overrides:

[getUIClassID](../../javax/swing/JComponent.html#getUIClassID%28%29) in class [JComponent](../../javax/swing/JComponent.html "class in javax.swing")

Returns:

the string "ColorChooserUI"

See Also:

JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)


getColor

public Color getColor()

Gets the current color value from the color chooser. By default, this delegates to the model.

Returns:

the current color value of the color chooser


setColor

public void setColor(Color color)

Sets the current color of the color chooser to the specified color. The ColorSelectionModel will fire a ChangeEvent

Parameters:

color - the color to be set in the color chooser

See Also:

Container.addPropertyChangeListener(java.beans.PropertyChangeListener)


setColor

public void setColor(int r, int g, int b)

Sets the current color of the color chooser to the specified RGB color. Note that the values of red, green, and blue should be between the numbers 0 and 255, inclusive.

Parameters:

r - an int specifying the amount of Red

g - an int specifying the amount of Green

b - an int specifying the amount of Blue

Throws:

[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang") - if r,g,b values are out of range

See Also:

Color


setColor

public void setColor(int c)

Sets the current color of the color chooser to the specified color.

Parameters:

c - an integer value that sets the current color in the chooser where the low-order 8 bits specify the Blue value, the next 8 bits specify the Green value, and the 8 bits above that specify the Red value.


setDragEnabled

public void setDragEnabled(boolean b)

Sets the dragEnabled property, which must be true to enable automatic drag handling (the first part of drag and drop) on this component. The transferHandler property needs to be set to a non-null value for the drag to do anything. The default value of the dragEnabled property is false.

When automatic drag handling is enabled, most look and feels begin a drag-and-drop operation when the user presses the mouse button over the preview panel. Some look and feels might not support automatic drag and drop; they will ignore this property. You can work around such look and feels by modifying the component to directly call the exportAsDrag method of aTransferHandler.

Parameters:

b - the value to set the dragEnabled property to

Throws:

[HeadlessException](../../java/awt/HeadlessException.html "class in java.awt") - ifb is true andGraphicsEnvironment.isHeadless() returns true

Since:

1.4

See Also:

GraphicsEnvironment.isHeadless(), getDragEnabled(), JComponent.setTransferHandler(javax.swing.TransferHandler), TransferHandler


getDragEnabled

public boolean getDragEnabled()

Gets the value of the dragEnabled property.

Returns:

the value of the dragEnabled property

Since:

1.4

See Also:

setDragEnabled(boolean)


setPreviewPanel

public void setPreviewPanel(JComponent preview)

Sets the current preview panel. This will fire a PropertyChangeEvent for the property named "previewPanel".

Parameters:

preview - the JComponent which displays the current color

See Also:

Container.addPropertyChangeListener(java.beans.PropertyChangeListener)


getPreviewPanel

public JComponent getPreviewPanel()

Returns the preview panel that shows a chosen color.

Returns:

a JComponent object -- the preview panel


addChooserPanel

public void addChooserPanel(AbstractColorChooserPanel panel)

Adds a color chooser panel to the color chooser.

Parameters:

panel - the AbstractColorChooserPanel to be added


removeChooserPanel

public AbstractColorChooserPanel removeChooserPanel(AbstractColorChooserPanel panel)

Removes the Color Panel specified.

Parameters:

panel - a string that specifies the panel to be removed

Returns:

the color panel

Throws:

[IllegalArgumentException](../../java/lang/IllegalArgumentException.html "class in java.lang") - if panel is not in list of known chooser panels


setChooserPanels

public void setChooserPanels(AbstractColorChooserPanel[] panels)

Specifies the Color Panels used to choose a color value.

Parameters:

panels - an array of AbstractColorChooserPanel objects


getChooserPanels

public AbstractColorChooserPanel[] getChooserPanels()

Returns the specified color panels.

Returns:

an array of AbstractColorChooserPanel objects


getSelectionModel

public ColorSelectionModel getSelectionModel()

Returns the data model that handles color selections.

Returns:

a ColorSelectionModel object


setSelectionModel

public void setSelectionModel(ColorSelectionModel newModel)

Sets the model containing the selected color.

Parameters:

newModel - the new ColorSelectionModel object


paramString

protected String paramString()

Returns a string representation of this JColorChooser. 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](../../javax/swing/JComponent.html#paramString%28%29) in class [JComponent](../../javax/swing/JComponent.html "class in javax.swing")

Returns:

a string representation of this JColorChooser


getAccessibleContext

public AccessibleContext getAccessibleContext()

Gets the AccessibleContext associated with this JColorChooser. For color choosers, the AccessibleContext takes the form of an AccessibleJColorChooser. A new AccessibleJColorChooser instance is created if necessary.

Specified by:

[getAccessibleContext](../../javax/accessibility/Accessible.html#getAccessibleContext%28%29) in interface [Accessible](../../javax/accessibility/Accessible.html "interface in javax.accessibility")

Overrides:

[getAccessibleContext](../../javax/swing/JComponent.html#getAccessibleContext%28%29) in class [JComponent](../../javax/swing/JComponent.html "class in javax.swing")

Returns:

an AccessibleJColorChooser that serves as the AccessibleContext of this JColorChooser



Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.