I have a command line script I saved in a file on my PC. How can I create a toolbar button in NB 7.0 so that clicking on this button will run my saved script? Also, what file extension should I name my script file so it will be executable, or does it matter at all?
Asked
Active
Viewed 1.1k times
2 Answers
10
Here is a Toolbar button tutorial. And your script can be anything that can be executed in or by Java, the NetBeans Platform does not constrain you in that manner

Tim Sparg
- 3,294
- 2
- 27
- 40
6
In addition to Tim's answer, you can create a simple shortcut to an Ant target, as outlined in the Netbeans Wiki:
- Open the Files window and find your build.xml
- Expand the build.xml to find your target
- Right-click your target and click "Create Shortcut..."
- Follow the wizard to create your button.
This can be used to create a menu item, toolbar button, keyboard shortcut or a custom Ant "mini-script."

RustyTheBoyRobot
- 5,891
- 4
- 36
- 55
-
Good point! Even four years later. ;-) Just a note: In NB I haven't found a way to change the ant target later. But these custom targets are stored as xml files under yourNbUserDirectory\config\Actions\Build. (where yourNbUserDirectory is the path you can find in NB in the Help | About dialog under "User directory"). – tomorrow Sep 20 '17 at 21:32