|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--com.ultraswing.DropDownButton
A flat button with drop-down menu.
Usage Example:
DropDownButton dropBtn = new DropDownButton("test button"); dropBtn.setSeparateButton(true); //so arrow part is separate from the main button JPopupMenu popup = new JPopupMenu(); dropBtn.setPopupMenu(popup); JMenuItem execute = popup.add(new JMenuItem("Run")); JMenuItem close = popup.add(new JMenuItem("Stop")); toolbar.add(dropBtn);
Field Summary |
Fields inherited from class javax.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 |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
DropDownButton(String text)
Creates a button with text. |
|
DropDownButton(String text,
Icon icon)
Creates a button with initial text and an icon |
Method Summary | |
void |
addActionListener(ActionListener l)
Adds an ActionListener to the button. |
protected void |
fireActionPerformed(ActionEvent event)
Notifies all listeners that have registered interest for notification on this event type. |
JPopupMenu |
getPopupMenu()
Returns the popup menu associated with this button |
void |
propertyChange(PropertyChangeEvent e)
|
void |
removeActionListener(ActionListener l)
Removes an ActionListener from the button. |
void |
setPopupMenu(JPopupMenu popup)
Sets the popup menu associated with this button |
void |
setSeparateButton(boolean b)
Sets true to make button and arrow separate. |
void |
setToolTipText(String tooltip)
Sets button tooltip |
void |
updateUI()
|
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DropDownButton(String text)
text
- the text of the buttonpublic DropDownButton(String text, Icon icon)
text
- the text of the buttonicon
- the Icon image to display on the buttonMethod Detail |
public void setToolTipText(String tooltip)
setToolTipText
in class JComponent
tooltip
- tooltip textpublic void setSeparateButton(boolean b)
public JPopupMenu getPopupMenu()
public void setPopupMenu(JPopupMenu popup)
public void addActionListener(ActionListener l)
l
- the ActionListener to be addedpublic void removeActionListener(ActionListener l)
l
- the listener to be removedprotected void fireActionPerformed(ActionEvent event)
event
- the ActionEvent objectpublic void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
public void updateUI()
updateUI
in class JPanel
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |