Ruben Laguna’s blog

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:

1
2
3
4

1
2
3
4
<span class='line'>&lt;folder name="Toolbars">
</span><span class='line'>        &lt;folder name="File_hidden"/>
</span><span class='line'>        &lt;folder name="UndoRedo_hidden"/>
</span><span class='line'>    &lt;/folder></span>

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:

Comments

Copyright © 2015 - Ruben Laguna - Powered by Octopress