Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
buoy.event.EventSource
buoy.widget.Widget
buoy.widget.BColorChooser
public class BColorChooser
extends Widget
showDialog()
to display it. showDialog()
will
automatically create a dialog, add the BColorChooser, display it, and block until the user
dismisses the dialog. You can reuse a single BColorChooser by repeatedly calling showDialog()
.
In addition to the event types generated by all Widgets, BColorChoosers generate the following event types:
Constructor Summary | |
| |
|
Method Summary | |
Color |
|
JColorChooser | |
String |
|
void |
|
void |
|
boolean |
|
Methods inherited from class buoy.widget.Widget | |
addEventLink , dispatchEvent , getBackground , getBounds , getComponent , getCursor , getFont , getMaximumSize , getMinimumSize , getName , getParent , getPreferredSize , hasFocus , isEnabled , isFocusable , isVisible , repaint , requestFocus , setBackground , setCursor , setEnabled , setFocusable , setFont , setName , setVisible |
Methods inherited from class buoy.event.EventSource | |
addEventLink , addEventLink , addEventLink , dispatchEvent , removeEventLink |
public BColorChooser()
Create a new BColorChooser whose initial color is white.
public BColorChooser(Color color, String title)
Create a new BColorChooser
- Parameters:
color
- the color which is initially selectedtitle
- the title to display on the dialog
public Color getColor()
Get the color selected in the BColorChooser.
public String getTitle()
Get the title displayed on the dialog.
public void setColor(Color color)
Set the color selected in the BColorChooser.
public void setTitle(String title)
Set the title displayed on the dialog.
public boolean showDialog(Widget parent)
Show a dialog containing this BColorChooser and block until the user closes it. After this method returns, you can callgetColor()
to determine what color was selected.
- Parameters:
parent
- the dialog's parent Widget (usually a WindowWidget). This may be null.
- Returns:
- true if the user clicked the OK button, false if they clicked the cancel button