File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Focus problems... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Focus problems..." Watch "Focus problems..." New topic

Focus problems...

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121


I am working with multiple JFrames on a Solaris platform...

I am trying to make it possible for the user to fill out some info on one JFrame, and when a button is pushed on that JFrame, to bring another JFrame to the top... I can use the toFront() method of Window, but the JFrame that comes to the front does not have focus, and should... toFront() works under the windows platform fine (i.e. the window comes to the front and has the focus), but on Solaris the window comes to the front, but the one in the back ( the one that the button is on ) still has the focus.

Does anyone know how to make the window that has been brought to the top have focus?


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Ashwin Desai
Ranch Hand

Joined: Jul 17, 2000
Posts: 124
How about using
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Nope... strangely, this does not work... ( but only on the Solaris CDE platform... ) I really assume that it is the actual requestFocus() call that toTop() makes that is not working... since the frame actually does come to the top... it just doesn't recieve focus... components inside the frames can requestFocus() and it works, but the frames themselves cannot...

Consider Paul's rocket mass heater.
subject: Focus problems...
It's not a secret anymore!