hi all, i am having trouble getting focus on JMenuBar in a JFrame at the start up of my application.i have tried grabFocus() requestFocus() jMenuBar.setRequestFocusEnabled(true) in a Window opening event of window listener ,nothing seems to be working. like to have some tips thanks, harcharan
harcharan kanwal
Ranch Hand
Joined: Jul 02, 2001
Posts: 64
posted
0
i guess you can simple achieve it by pressing F10 key on the keyboard.if i am not wrong, do we specify keyboard operations on the application in our user documentation. any comments thanks
parthiban subramaniam
Ranch Hand
Joined: May 15, 2002
Posts: 116
posted
0
hi, why do you need to get the foucs on to the menubar anyways ??..i dont think any application does that when it start's up ..
hmm am not sure abut the f10 key it might be specific to windows .. cheers, parthi
Even crazy and silly looking problems are sometimes real.
harcharan kanwal
Ranch Hand
Joined: Jul 02, 2001
Posts: 64
posted
0
i was just testing ,if somebody wants to use keyboard instead of a mouse,do you have any thoughts about this.yes i am developing on windows.any thoughts about this thought. thanks
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Harcharan,
So now if the user presses ALT+(mnemonic for parent menu)ALT+B or by simply pressing CTRL+B then the book item will be selected. Hope this helps, Michael Morris [ September 25, 2002: Message edited by: Michael Morris ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
harcharan kanwal
Ranch Hand
Joined: Jul 02, 2001
Posts: 64
posted
0
hi Michael, do we specify keyboard operations on the application in our user documentation. thanks!
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi harcharan,
do we specify keyboard operations on the application in our user documentation.
I did and I think you would be remiss if you did not mention it. Michael Morris
Valentin Crettaz
Gold Digger
Sheriff
Joined: Aug 26, 2001
Posts: 7610
posted
0
Here is a list of supported key shortcuts for menus: http://java.sun.com/products/jlf/ed2/book/Appendix.A9.html I recommend to read (or at least skim) through the (free) Java Look & Feel design guidelines. You may learn a lot about how to make usable and ergonomic GUIs. Also, the quality of the GUI you will produce with the kind of information contained within this book is far better than the one you would get from any IDE in my opinion. This is not required for SCJD but if you are planning on taking your time anyway, why not reading this book.