Java

Moderators: zibadian
Number of threads: 7836
Number of posts: 18235

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how can I set mnemonic to a MenuItem Object? Posted by yanghui1023 on 20 Oct 2006 at 6:36 AM
I want my menuitem show as "New Ctrl+N", and there is a line under the first N. How can I realize it? is there a method to set mnemonic to it?
Report
Re: how can I set mnemonic to a MenuItem Object? Posted by zibadian on 20 Oct 2006 at 8:40 AM
: I want my menuitem show as "New Ctrl+N", and there is a line under the first N. How can I realize it? is there a method to set mnemonic to it?
:
As you can see from this page:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JMenuItem.html
JMenuItem descends from the AbstractButton class.
And as you can see here:
http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/AbstractButton.html#setMnemonic(char)
The AbstractButton has a setMnemonic(). More help than this I cannot give you. I used it in one of my projects and it showed the underline perfectly. I don't think continuing to repeat the same question, will yield any better answers.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.