In the previous article we introduced a callback object, which allows us to callback to NetBeans and update it. Now we want to create a submenu with three actions that will give us the option to choose from our Base ViewrFX, Open ViewerFX and External ViewerFX.
Creating the Submenu
Step 1. Create a NetBeans Module and an Action. NetBeans has this beautiful built-in wizards for creating Actions and Topcomponents. We will use the action wizard to create our submenu.
Step 2. Adding More Actions. You will have to create one or more actions. This depends on the number of menu items you want to have under the submenu. We will go ahead and create two more actions but before we do that, there’s one more thing we need to do.
Below is what the your generated action class should look like.
Because we’ve done a clean and build, this time we will do something slightly different when creating new actions using the action wizard. In the GUI Registration, we need to select File | PDF Viewer under the Menu drop down option.
Once you have created all the actions, we are in the position to run and test our new feature.
<filesystem> <folder name="Menu"> <folder name="File"> <folder name="PDF Viewer"> <attr intvalue="1000" name="position"/> </folder> </folder> </folder> </filesystem>
Latest posts by Ernest Duodu (see all)
- 10 things Developers should know about Windows 10 - September 15, 2015
- How to test your Java Application using PMD, and Jenkins - July 30, 2015
- Setting up Continuous Testing with Jenkins - July 23, 2015
- How to Build Java Projects with Apache ANT - July 21, 2015
- How to upload your Java artifact to Maven Central - June 30, 2015