Article View: borland.public.jbuilder.java.swing
Article #13160Keyboard accelerators???
From: Brad Pepers
Date: Mon, 14 Sep 1998 00:00
Date: Mon, 14 Sep 1998 00:00
39 lines
2409 bytes
2409 bytes
I'm trying to use keyboard accelerators for menus. You know something like Alt-F for the File menu and then "x" to exit. Whenever I use setAccelerator() on a menu though I get a ton of error messages when I use the application plus the frame doesn't show up. I would post the error messages from the stack trace but it scrolls way past so I'm missing the real important part (note: how do I fix this???). When I run the application through the debugger I don't even see the errors scroll by. Why is this? Also I would like to have global key bindings for a frame. Something like F1 for help, F9 to save data changes, ... How is this done in Swing? I've tried binding to the JPanels and it doesn't work. Do I have to have a keyPressed binding for every JTextField/JdbTextField on the screen? And finally are there any plans to support the Action class better in JBuilder? I'm creating Actions for saveChanges, DeleteRow, help, ... and then using JMenu.add(Action) to add them but then I can no longer use the visual tool for design. I like using them (and want to bind the Action to keys as previously mentioned) and think its a nice design technique but JBuilder doesn't really seem to know about them. Opps... Another finally... I would like the TAB key and Enter key to do the same thing (ie: validate field data and if its alright, move to the next focus field). I can't quite figure it out though. Pressing Enter causes the ActionEvent but doesn't go to the next field. Pressing TAB goes to the next field but no ActionEvent. I end up binding to the FocusLost event to check if the value of the field has changed and handle it in special ways. Any help or hints on better ways to do this? -- Brad Pepers Linux Canada Inc. Home of Linux products in Canada! http://www.linuxcanada.com Proud supporter of Cyclades, Red brad@linuxcanada.com Hat, and Caldera.
Technical Details
Message-ID:
<35FE010B.7DF802C3@linuxcanada.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,858c838fa4c06d5f,start X-Google-Attributes: gid111d45,public From: Brad Pepers <brad@linuxcanada.com> Subject: Keyboard accelerators??? Date: 1998/09/14 Message-ID: <35FE010B.7DF802C3@linuxcanada.com> X-Deja-AN: 391251620 Content-Transfer-Encoding: 7bit Organization: Linux Canada Inc Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing