I want to add an option to show or hide the menu bar, the problem is that keyboard accelerators doesn't work when the menu bar is hidden ( menuBar.setVisible(false) ).
I've finally made a class called "JXCollapsibleMenuBar". When collpasible property is set to true the menubar disappears (by putting height to 0, key events are processed), but when a MenuItem obtains the focus (for example by pressing alt key) the menubar appears again.
Here is the class: http://txigreman.pastebin.com/qd7NtRB2
PD: Yes, menu's listener should be deleted when the menu item is removed... Maybe in v2.0, I don't remove menu items. lol
Add [url=http://java.sun.com/docs/books/tutorial/uiswing/misc/keybinding.html]key bindings[/url] (short cuts) for the menu actions as well.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.