Thanks Tom,

But I'm developing a TextArea bean. Now If you consider
as a single bean, it will never know what the next component
is. In such cases i will never know what is the parameter to be
passed as setNextFocusableComponent(). so I need to use
transferFocus() which will always transfer the focus in the
forward direction. So my shift + tab will not work.

Thanks a lot for the response.

kind regards
abhay
 

Tom Jordan wrote:

// 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

Reply via email to