Ruben Laguna's blog

Mar 8, 2009 - 1 minute read - actions api folder hidden hide layer netbeans platform remove saveaction toolbar toolbars

How to hide/remove the Save, Undo and Redo buttons on the Toolbar (Netbeans Platform)

The default Netbeans Platform Application generated by the Netbeans IDE wizard has the Save, Undo and Redo button showing up in the toolbar by default.

Since my applications doesn’t have anything to save I decided to hide those buttons.

I turns out that remove them is really simple, I knew that I had to fiddle with the layer.xml file and hide something but I didn’t know exactly what. At the end I found the solution buried in this A NetBeans Platform Sample and Tutorial.

Just add this to the layer.xml:

<folder name="Toolbars">
<folder name="File_hidden"/>
<folder name="UndoRedo_hidden"/>
</folder>

And that’s it the buttons are gone.

If you don’t want to edit the layer.xml by hand go to the Important Files / XML Layer / <this layer in context> / Toolbars and delete File and UndoRedo there. That will turn the element into hidden elements.

xml layer

References: