• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to move a window in front  RSS feed

 
Lars Tode
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried a long time to move a window automatic in front. I used for this the methods
myWindow.toFront(); and
myWindow.show();
My problem is, that this 2 methods sometimes doesn't work.
Are the some other methods that I can use for this?
greetx
Lars
 
Rene Liebmann
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lars,
as I know, Window.show() and window.toFront() are the only methods, which fits your needs.
As I red in the API, there may be problems with those operations on some OS. Which OS do you use?
Rene
 
Lars Tode
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use a windows-system
greetx
Lars
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
toFront() moves the window to the front when you call it... that doesn't mean that users can't select other windows that may then be on top of the window you called toFront() on... if you are trying to make a system modal window ( like MS task manager or WinAmp ( when you choose 'Always on top' ) ) you will have to use some way to access the native OS ( through JNI or some other way... ) to make a window truly system modal. I found some code here detailing how to do this through a JNI call to Borland C++.

-Nate
 
Lars Tode
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i don't want "Always on top", i only try if somthing change in my window to move it to front.
Sometimes it does what i want, sometimes i stay behind the other windows.
Is there a method where i can finde out if there are some other windows in front of mine?
greetx
Lars
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!