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 returns
null.
- 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 - if GraphicsEnvironment.isHeadless()
returns true.
- See Also:
GraphicsEnvironment.isHeadless()