Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

An awt window on top of all other windows

 
Ind Kumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I wrote a program to pop up a window after a certain period. I used thread in my program, when i run the program it just sleeps for a fixed time and then displays a window.
Now, my problem is, Once i start the program and open other applications ( explorer,browser,word document ), the window that is opened by my java program does not come on other windows, it just opens and an icon stays in the toolbar, i need to click on the icon on the toolbar to view the window. What should i do to bring the window on all other opened windows.
thanks
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The method you're looking for is toFront(), which makes a window attempt to come to the top of all windows on the display. This works like you'd expect, except on Windows XP(if I recall correctly), which just flashes the button on the taskbar for the window.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic