aspose 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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: focus in textarea