Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bring first frame to TOP  RSS feed

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I launch my java application, I open a frame that has no parent. If i don't click any other windows(not related to my app) on my pc, the frame is displayed. But if I happen to click on any other window or application before the frame shows, the frame opens but it is hidden behind the other windows. How can I force my frame to come on top of all applications once it is launched?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using the toFront() method of the frame. However, there is always a timing issue involved. Even if you use that method and are clicking on other things while waiting for that window to open, It could bring it to the front, and then you click on something without realizing that it had already shown.
Anyway, toFront() is the method to use though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!