|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JColorChooser
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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
protected | JColorChooser.AccessibleJColorChooser
The class used to obtain the accessible context for this object. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
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 com.sun.java.swing.JComponent | |
accessibleContext , 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 |
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(com.sun.java.swing.colorchooser.ColorSelectionModel model)
Creates a color chooser pane with the specified ColorSelectionModel. |
Method Summary | |
void | addChooserPanel(com.sun.java.swing.colorchooser.AbstractColorChooserPanel panel)
Adds a color chooser panel to the color chooser. |
static JDialog | createDialog(Component c,
String title,
boolean modal,
JColorChooser chooserPane,
ActionListener okListener,
ActionListener cancelListener)
Creates and returns a new dialog containing the specified ColorChooser pane along with "OK" |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JColorChooser |
com.sun.java.swing.colorchooser.AbstractColorChooserPanel[] | getChooserPanels()
|
Color | getColor()
Gets the current color value from the color chooser. |
JComponent | getPreviewPanel()
|
com.sun.java.swing.colorchooser.ColorSelectionModel | getSelectionModel()
|
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. |
com.sun.java.swing.colorchooser.AbstractColorChooserPanel | removeChooserPanel(com.sun.java.swing.colorchooser.AbstractColorChooserPanel panel)
Removes the Color Panel specified. |
void | setChooserPanels(com.sun.java.swing.colorchooser.AbstractColorChooserPanel[] panels)
|
void | setColor(Color color)
Sets the current color of the color chooser to the specified color. |
void | setColor(int r,
int g,
int b)
Sets the current color of the color chooser to the specified RGB color. |
void | setColor(int c)
Sets the current color of the color chooser to the specified color. |
void | setPreviewPanel(JComponent preview)
Sets the current preview panel. |
void | setSelectionModel(com.sun.java.swing.colorchooser.ColorSelectionModel newModel)
Set the model containing the selected color. |
void | setUI(ColorChooserUI ui)
Sets the L&F object that renders this component. |
static Color | showDialog(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 java.awt.Container | |
add , add , add , add , add , addContainerListener , addImpl , countComponents , deliverEvent , doLayout , findComponentAt , findComponentAt , getComponent , getComponentAt , getComponentAt , getComponentCount , getComponents , getLayout , insets , invalidate , isAncestorOf , layout , list , list , locate , minimumSize , paintComponents , paramString , preferredSize , print , printComponents , processContainerEvent , processEvent , remove , remove , removeAll , removeContainerListener , setLayout , validate , validateTree |
Methods inherited from class java.lang.Object | |
clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait |
Field Detail |
public static final String SELECTION_MODEL_PROPERTY
public static final String PREVIEW_PANEL_PROPERTY
public static final String CHOOSER_PANELS_PROPERTY
protected AccessibleContext accessibleContext
Constructor Detail |
public JColorChooser()
public JColorChooser(Color initialColor)
initialColor
- the initial color set in the chooserpublic JColorChooser(com.sun.java.swing.colorchooser.ColorSelectionModel model)
initialColor
- the initial color set in the chooserMethod Detail |
public static Color showDialog(Component component, String title, Color initialColor)
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 shownpublic static JDialog createDialog(Component c, String title, boolean modal, JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener)
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 pressedpublic ColorChooserUI getUI()
public void setUI(ColorChooserUI ui)
ui
- the ColorChooserUI L&F objectUIDefaults.getUI(com.sun.java.swing.JComponent)
public void updateUI()
JComponent.updateUI()
public String getUIClassID()
JComponent.getUIClassID()
,
UIDefaults.getUI(com.sun.java.swing.JComponent)
public Color getColor()
public void setColor(Color color)
color
- the color to be set in the color chooserJComponent.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void setColor(int r, int g, int b)
r
- an int specifying the amount of Red
g
- an int specifying the amount of Green
b
- an int specifying the amount of Bluepublic void setColor(int c)
c
- an int 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.public void setPreviewPanel(JComponent preview)
color
- the color to be set in the color chooserJComponent.addPropertyChangeListener(java.beans.PropertyChangeListener)
public JComponent getPreviewPanel()
public void addChooserPanel(com.sun.java.swing.colorchooser.AbstractColorChooserPanel panel)
public com.sun.java.swing.colorchooser.AbstractColorChooserPanel removeChooserPanel(com.sun.java.swing.colorchooser.AbstractColorChooserPanel panel)
name
- a string that specifies the panel to be removedpublic void setChooserPanels(com.sun.java.swing.colorchooser.AbstractColorChooserPanel[] panels)
public com.sun.java.swing.colorchooser.AbstractColorChooserPanel[] getChooserPanels()
public com.sun.java.swing.colorchooser.ColorSelectionModel getSelectionModel()
public void setSelectionModel(com.sun.java.swing.colorchooser.ColorSelectionModel newModel)
newModel
- the new ColorSelectionModel objectpublic AccessibleContext getAccessibleContext()
|
Java Platform 1.2 Beta 4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |