wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes An awt window on top of all other windows 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 "An awt window on top of all other windows" Watch "An awt window on top of all other windows" New topic

An awt window on top of all other windows

Ind Kumar

Joined: Mar 11, 2004
Posts: 1
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.
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

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.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Consider Paul's rocket mass heater.
subject: An awt window on top of all other windows
Similar Threads
Frame invoked on an Applet
Making icons Max,Min as INVISIBLE in TitleBar
Win2k shortcut madness
Corrupt/black icons in WSAD
How to Close multiple child windows from a parent window