Probably by the time your actionPerformed() method is called as the result of the button click, the focus has already been transferred to the button. There are probably a bunch of ways you can fix this.
I would probably try adding a FocusListener to all your JTextPanes. The FocusListener will need to keep track of which JTextPane last had focus. On Friday, December 14, 2001, at 05:19 AM, Rahul Kumar wrote: > Have recvd no reply on this... Pls help. > I have several JTextareas. When a user presses a button I need to know > which one has focus. Have tried hasFocus() but no luck. How can i know > where keyboard focus is ? The textareas are in scrollpanes. This is > JDK1.3. > Thanks, rahul. > _______________________________________________ > Advanced-swing mailing list > [EMAIL PROTECTED] > http://eos.dk/mailman/listinfo/advanced-swing > > -- Bill Tschumy Otherwise -- Austin, TX [EMAIL PROTECTED] _______________________________________________ Advanced-swing mailing list [EMAIL PROTECTED] http://eos.dk/mailman/listinfo/advanced-swing
