A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Swing / AWT / SWT
Author
Tabulation Order in a frame
Laurent S
Greenhorn
Joined: Sep 27, 2001
Posts: 15
posted
Oct 04, 2001 02:37:00
0
I have some
JEditorPane
in my frame. How can I pass from one to the oder by pression tabulation key?
Thx
Laurent S
Greenhorn
Joined: Sep 27, 2001
Posts: 15
posted
Oct 05, 2001 00:38:00
0
i have the answer to my question:
We need to override the FocusManagers default behaviour as follows :
JEditorPane jed = new JEditorPane(); jed.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_TAB){ JComponent source = (JComponent)(e.getSource()); FocusManager fm =FocusManager.getCurrentManager(); if (e.isShiftDown()) fm.focusPreviousComponent(source); else fm.focusNextComponent(source); e.consume(); } }});
[This message has been edited by Laurent S (edited October 05, 2001).]
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: Tabulation Order in a frame
Similar Threads
AJAX or JavaScript
IntelliJ 4.0: My favorite shortcuts
the bug parade
trim() removes newline char at the front?
NMTOKENS (supports seperation with tabs, CRs, extra whitespaces OR not?)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter