Java window pop-up under other windows

_dede_
_dede_ used Ask the Experts™
on
Hi experts,

I'm having a little trouble here with java.

When I open an new window, it appear in the background, underneath all other windows.  Is therer some kind of configuration that control the position of new windows?

Here is my setup:
Java serveur: Solaris 5.10 java 1.6.0.20
Java client: Solaris 5.10 java 1.6.0.20

I'm kind of new to java so any clue will certainly help.

Thanks in advance,

Alex
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:
Most windowing systems don't allow that sort of absolute control - otherwise badly behaved apps would be hogging focus all the time.
Try the following:

http://java.sun.com/javase/6/docs/api/java/awt/Window.html#toFront()
Mick BarryJava Developer
Top Expert 2010

Commented:
what sort of window is it?

Window will only open at the front if the application itself is at the front.

If its a dialog then make sure you specify one of your application windows as its parent/owner
Mick BarryJava Developer
Top Expert 2010

Commented:
some code here to help ensure it opens at the front

http://stackoverflow.com/questions/309023/howto-bring-a-java-window-to-the-front

Author

Commented:
Hi,

Sorry the long wait, I've been out of the job for a couple of days....

Actually, the setVisible(true) and toFront() were already called in the class(which is a JFrame, by the way).

The frame seem to appears in front for a fraction of second.Then the application (non-java app) who called my java frame move back to the front.

I was thinking of a workaround, maybe using SetAsAlwaysOnTop(); The frame is modal so I don't care if it's stay on top.

Would you recommand that method, knowing that the application need to be deploy on AIX server (running java 1.5) AND Solaris (running java 1.6)?

Regards,

Alex

Java Developer
Top Expert 2010
Commented:
try using a window listener to bring it back to the front

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial