Java: How do I use "\t" in a JMenuItem?
Trying to make Java menu items that look like the following:
Code:
New... New... Open...Enter Move...F7 Copy...F8 I tried spaces instead, and that works, but it looks really sloppy. Here is an example of my code: JMenuItem moveItem = new JMenuItem("Move...\t\t\tF7"); moveItem.setMnemonic('M'); fileMenu.add(moveItem); Does anybody know how to make "\t" work? |
Hi,
I think that you want accelerators. Take a look at this page: http://www.java2s.com/ExampleCode/Sw...celerators.htm Good luck! |
All times are GMT -5. The time now is 02:05 AM. |