How to add a dropdown menu to toolbar in NetBeans Platform

To add a dropdown menu to toolbar, you should extends CallableSystemAction and override method:

public Component getToolbarPresenter()

Dropdown menu should be banded with a JToggleButton, when JToggleButton is pressed down, show a JPopupMenu on JToggleButton.

Example:

public class PickDrawingLineAction extends CallableSystemAction {
    private static JToggleButton toggleButton;
    private static ButtonGroup buttonGroup;
    private static JPopupMenu popup;
    private MyMenuItemListener menuItemListener;
    
    List

Comments

No comments.

Add New Comment