Create Plugin in NetBeans IDE
1. Open NetBeans IDE
2. Go to File Select New Project or press (CTRL+Shift+N)
3. In Categories panel select Netbeans Module>>Select Module in Projects Panel>>Click Next
4. Give a name of your project "MyPlugin">Give Project Location>Select Standalone Module if not selected>>Click Next.
5. In Code Name Base write "org.myApp.App1">>Click Finish.
Project Created Successfully. Below Show file structure
6. Right Click the project node and Choose New>Other.
7. In Categories panel select Module Development>>Select Action in File Type Panel>>Click Next.
8. Action Type: If Always Enabled Not selected then Select it >> Click Next.
9. GUI Registration Category:
- Category of your choice (I am choosing Tools) or Create New Category by typing a name in Category Field.
- Check Global Menu Item.
- Select Menu: In my case i am choosing Help menu where my Menu Added in my IDE Select Position where you want to place menu in my choice i have select About-Here.
- Add a separator after or before i am choosing Separator Before. >> Click Next.
Created Java File: MyClickAction.java
12. Write your code in actionPerformed block
@Override
public void actionPerformed (ActionEvent e) {
// Write Code Here
JOptionPane.showMessageDialog (null, “Your Message Here”,"Title", JOptionPane.INFORMATION_MESSAGE);
}
Save File (CTRL+S).
13. Right click on project node and click Create NBM.
14. Your plugin created successfully "org-myApp-App1.nbm". (Your project location\MyPlugin\build).Press CTRL-2 to view your nbm files in IDE or you see this in your project location under build folder.
Installation of created plugin in your IDE.
1.In your NetBeans IDE go to Tools Menu>>Click Plugin.
2.Go to Downloaded tab and click on “Add Pluging…” button. Select your created plugin from your location in project build folder.
Click on “MyMenu” to see results.
Next topic : How to Distribute plugin to client.
https://amzn.to/36JpDho
Thanks
Comments
Post a Comment