PopupButton
JPopupButton is a button that gives access to a popup menu. The button has a small arrow indicator on the bottom right. The JPopupButton class extends the Swing JButton component.

A popup button with a popup panel
Creation
public JPopupButton() public JPopupButton(String text) public JPopupButton(String text, Icon icon)
The default constructor creates an empty popup button. The other constructors allows you to specify the button's text or an image.
Methods
public void setPanel(javax.swing.JPanel panel) public void addMenuItem(javax.swing.JMenuItem item) public void addComponentItem(JComponent component) public void removeItem(int index) public void setPopupAlignment(int alignment) public void hidePopup()
A JPopupMenu allows you to either set a JPanel to the popup window or display some JMenuItem options. A panel occupies the whole area of the popup window as you would expect from a BorderLayout.CENTER positioning. The setPopupAlignment method allows you to align the popup window left or right (the default).