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 jframe always on top Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jframe always on top" Watch "jframe always on top" New topic
Author

jframe always on top

Peter Prose
Greenhorn

Joined: Oct 30, 2001
Posts: 1
I'm writing a Java application for NT that has to be visible on the desktop at all times, but not have the focus at all times. The setVisible(), toFront(), and show() methods all take the focus, so a new window opened in the same part of the desktop would "fight" with the application for the focus.
Any help would be greatly appreciated.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I don't really see any way to do this, because you are mixing native OS and Java frames... you can mess with the Java frame to request the focus if it loses the focus, but then you can't give the focus to a non-java frame that the Java frame has no reference to. There probably are some third party librarys that could let you do this by using JNI to native code, but there is no way to do this in just Java.

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jframe always on top
 
Similar Threads
KeyListener Stops Working
Detecting Key Presses in Windows (without focus)
Want to obtain the url being displayed in the currently active browser window
Detecting Key Presses in Windows (without focus)
Using Java as opposed to another language where performance counts