This brief lesson will walk you through adding the custom context menu you created, to the CARMADeveloperView. You will do this by overriding the createAction method.
To add the custom context menu to the CARMADeveloperView:
- Open the CARMADeveloperView class by opening the view package and double-clicking on the source file. It will open in the editor.
- Scroll down and create the following method
protected void createActions()
{
setActionGroup(new CustomMainActionGroup(this));
}
This code sets the default action group to the CustomMainActionGroup you created.
- Add import menu.CustomMainActionGroup; to your list of import statements at the top of the CARMADeveloperView class.
- Save the source and debug any errors.