How to remove items from menu in netBeans platform?

断了今生、忘了曾经 提交于 2019-11-30 14:53:30

问题


I have module application. When I run it, the main window of that app has quite complex menu. How to remove some items from menu?


回答1:


You can remove menu items from the menu bar by adding entries to your project's layer.xml file.

You should read through 'Tweaking the User Interface' from the 'NetBeans Platform HTML Editor' tutorial to get a rough idea of what you will need to do.

There is another tutorial-ish description of using the layer file to hide items, too.




回答2:


In netbeans 8.0 , the layer file is generated when ever a module contains 'configuration type' annonations in java code, for example a module with top component. The generated layer.xml is located at build directory classes/META-INF/generated-layer.xml. However, the generated-layer.xml is not editable. To hide/show menubar / tool bar, click on the module, click other and add XML layer file. Now under the important files you can see XML layer. Expand it. Now expand . Expand the "Menu Bar". Delete the menu bar which you don't want.




回答3:


The easier way appears to be, as Martin Krauskopf wrote:

Just go to:

Projects view (Ctrl-1) >> your module >> Important Files >> XML Layer >> Menu Bar >> Help

and delete what you want (it will actually generate appropriate content in layer.xml of the module).




回答4:


You can remove it in layer.xml

layer in context - Menu Bar

here's the link

http://platform.netbeans.org/tutorials/nbm-htmleditor.html



来源:https://stackoverflow.com/questions/2435153/how-to-remove-items-from-menu-in-netbeans-platform

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