Override getActions(). Create a custom subclass of javax.swing.Action which implements the interface Presenter.Popup. Return a JMenu with whatever you want on it from getPopupPresenter(). Return that action in the array of actions from getActions().

Source: NetBeans FAQ