站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

DropDownButtonFactory (UI Utilities API) - NetBeans API Javadoc (Current Development Version)

org.openide.awt 6.11.0

org.openide.awt
Class DropDownButtonFactory

java.lang.Object
  extended by org.openide.awt.DropDownButtonFactory

public final class DropDownButtonFactory
extends Object

Factory creating buttons with a small arrow icon that shows a popup menu when clicked. The default button behavior hasn't changed.

Since:
6.11

Field Summary
static String PROP_DROP_DOWN_MENU
          Use this property name to assign or remove popup menu to/from buttons created by this factory, e.g.
 
Method Summary
static JButton createDropDownButton(Icon icon, JPopupMenu dropDownMenu)
          Creates JButton with a small arrow that shows the provided popup menu when clicked.
static JToggleButton createDropDownToggleButton(Icon icon, JPopupMenu dropDownMenu)
          Creates JToggleButton with a small arrow that shows the provided popup menu when clicked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_DROP_DOWN_MENU

public static final String PROP_DROP_DOWN_MENU
Use this property name to assign or remove popup menu to/from buttons created by this factory, e.g. dropDownButton.putClientProperty( PROP_DROP_DOWN_MENU, new JPopupMenu() ) The property value must be JPopupMenu, removing this property removes the arrow from the button.

See Also:
Constant Field Values
Method Detail

createDropDownButton

public static JButton createDropDownButton(Icon icon,
                                           JPopupMenu dropDownMenu)
Creates JButton with a small arrow that shows the provided popup menu when clicked.

Parameters:
icon - The default icon, can be null
dropDownMenu - Popup menu to display when the arrow is clicked. If this parameter is null then the button doesn't show any arrow and behaves like a regular JButton. It is possible to add the popup menu later using PROP_DROP_DOWN_MENU client property.
Returns:
A button that is capable of displaying an 'arrow' in its icon to open a popup menu.

createDropDownToggleButton

public static JToggleButton createDropDownToggleButton(Icon icon,
                                                       JPopupMenu dropDownMenu)
Creates JToggleButton with a small arrow that shows the provided popup menu when clicked.

Parameters:
icon - The default icon, can be null
dropDownMenu - Popup menu to display when the arrow is clicked. If this parameter is null then the button doesn't show any arrow and behaves like a regular JToggleButton. It is possible to add the popup menu later using PROP_DROP_DOWN_MENU client property.
Returns:
A toggle-button that is capable of displaying an 'arrow' in its icon to open a popup menu.

org.openide.awt 6.11.0

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.