This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
Using Java as opposed to another language where performance counts
Want to obtain the url being displayed in the currently active browser window
KeyListener Stops Working
Detecting Key Presses in Windows (without focus)
Detecting Key Presses in Windows (without focus)