File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes focus in textarea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "focus in textarea" Watch "focus in textarea" New topic
Author

focus in textarea

RameshKumar MuthuKumar
Greenhorn

Joined: May 25, 2005
Posts: 8
i'm using two screens,
in the second one i use one textarea.
when i press continue button in the first page the focus should be on that textarea.
its working nicely.
when i use the go back button in the second page,all the fields in the second page should be cleared and first page should come.
its also working nicely,
the problem is when i again press continue the second page is showed but the focus went somewhere.....
i dont know why,
and when i skip the clearing coding for the textarea i'm getting the focus...
so whats the problem with clearing the textfield???
anyone pls tell me the solution
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> anyone pls tell me the solution

try adding this line at the end of your 'continue' method
[textArea].requestFocusInWindow();

if still not working, post a small sample program that demonstrates the problem
 
jQuery in Action, 2nd edition
 
subject: focus in textarea