This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes JFrame always on top Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame always on top" Watch "JFrame always on top" New topic
Author

JFrame always on top

Joel de Matos
Greenhorn

Joined: Nov 10, 2003
Posts: 16
Hello, i've searched for this in the forum but i didn't find anything usefull.
What i want is to make a JFrame to be always on top but not stealing the focus.
Scenario: I have a maximized app and i have a smaller jframe on top. When i click in the "main" application i want my JFrame to be on top of it but without stealing the focus from the application.
I have this code:

Can you help me?
Thanks!
[ November 20, 2003: Message edited by: Joel de Matos ]
VIJAY Yadlapati
Ranch Hand

Joined: Aug 04, 2003
Posts: 175
Use JDialog rather than JFrame, and no need to implement FocusListener.
Here is a small example..
Joel de Matos
Greenhorn

Joined: Nov 10, 2003
Posts: 16
Can't use JDialog... Doesn't have a maximize button :roll:
It really has to be a JFrame.
Thanks anyway
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

Originally posted by Joel de Matos:

Scenario: I have a maximized app and i have a smaller jframe on top. When i click in the "main" application i want my JFrame to be on top of it but without stealing the focus from the application.

Sounds like a job for JInternalFrame.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JFrame always on top