org.tigris.swidgets
Class PopupButton
ModalButton
org.tigris.swidgets.PopupButton
public class PopupButton
extends ModalButton
A button that displays a popup when pressed. The popup can contain
any Component.
PopupButton() - Constructs a new PopupButton with no popup assigned.
|
PopupButton(Component c, Icon icon) - Constructs a new PopupButton with the specified popup component
and button icon
|
Component | getPopupComponent() - Returns the component that is displayed within the popup.
|
void | setIcon(Icon icon) - Sets the button icon.
|
void | setPopupComponent(Component c) - Sets the component to be displayed within the popup.
|
protected void | showPopup() - Called when the user clicks the button.
|
PopupButton
public PopupButton()
Constructs a new PopupButton with no popup assigned.
PopupButton
public PopupButton(Component c,
Icon icon)
Constructs a new PopupButton with the specified popup component
and button icon
c
- the component to popupicon
- the button icon
getPopupComponent
public Component getPopupComponent()
Returns the component that is displayed within the popup.
setIcon
public final void setIcon(Icon icon)
Sets the button icon. Overridden to automatically add a drop down icon
to the right of the icon image.
icon
- the new button icon
setPopupComponent
public void setPopupComponent(Component c)
Sets the component to be displayed within the popup.
c
- the new popup component
showPopup
protected void showPopup()
Called when the user clicks the button. This method will show the
popup component in a popup menu. Subclasses can override this
method to perform actions before the popup is shown.