How to create a custom button in Netbeans toolbar?

我只是一个虾纸丫 提交于 2019-12-21 12:11:37

问题


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?


回答1:


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




回答2:


In addition to Tim's answer, you can create a simple shortcut to an Ant target, as outlined in the Netbeans Wiki:

  1. Open the Files window and find your build.xml
  2. Expand the build.xml to find your target
  3. Right-click your target and click "Create Shortcut..."
  4. 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."



来源:https://stackoverflow.com/questions/6331320/how-to-create-a-custom-button-in-netbeans-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!