Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jframe always on top" Watch "jframe always on top" New topic

jframe always on top

Peter Prose

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

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.


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: jframe always on top
It's not a secret anymore!