// The code below cycles focus as follows:
//
// jTxtArea -> jTxtField1 -> jTxtField2 -|
//    ^----------------------------------'
 
   JTextArea jTxtArea = new JTextArea ();
   JTextField jTxtField1 = new JTextField();
   JTextField jTxtField2 = new JTextField();
 
   // Note: this is deprecated in java 1.4
   // (replaced by FocusTraversalPolicy), but still works well with
   // Tab and Shift-Tab in Java 1.2.2, 1.3 and 1.4.1.
   jTxtArea.setNextFocusableComponent(jTxtField1 );
   jTxtField1.setNextFocusableComponent(jTxtField2);
   jTxtField2.setNextFocusableComponent(jTxtArea);

-----Original Message-----
From: abhay [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 8:08 AM
To: jdjlist
Subject: [jdjlist] focus problem
         Hi all,

Is there any better way to transfer a focus other than
transferFocus()  ??

I want my focus to go to the next component when the
user presses the TAB in the JTextArea. As of now, I have
implemented it by using transferFocus() .. but the problem
comes when i press SHIFT + TAB...

transferFocus() is a shady method because it will always
propogate the focus in the forward direction. Unfortunately
there is no way to transfer the focus in backward direction
(at least i cant think of ..) ?

Does anyone has any ideas how to transfer the focus in
the reverse direction .. or may be at least to find out the
direction of the focus ?
 

kind regards
abhay
  ---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk

---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk

THIS TRANSMISSION, INCLUDING ANY ATTACHMENTS OR FILES,

CONTAINS AIRNET COMMUNICATIONS CORPORATION CONFIDENTIAL

AND PROPRIETARY INFORMATION WHICH MAY BE OTHERWISE EXEMPT

FROM DISCLOSURE.

The information is intended to be for the exclusive use of the individual

or entity named above. If you are not the intended recipient,

be advised that any disclosure, copying, distribution or other use

of this information is strictly prohibited. If you have received this

transmission in error, please notify us by telephone at 1-321-984-1990 or

by email to [EMAIL PROTECTED] immediately and do not read, print

or save this information in any manner.

Reply via email to