Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jframe always on top

 
Peter Prose
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic