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 Dialog Always to front 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 "Dialog Always to front" Watch "Dialog Always to front" New topic
Author

Dialog Always to front

Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
I have a Swing Application with a Desktop & JInternal Frames & I call a Modal Dialog. When the dialog pops up, you cant access anything in the Desktop - this is fine. But, when you click on the Desktop, the Dialog shoots to the back.
Is there anyway I can force the dialog to be to the Front until it is closed?
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Java dialogs are modal to the application, not to the system...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

In case Nathan didn't answer your question, you have to set the parent window in the Dialog. Maybe you are setting it to Null??
------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Dave Donohoe
Ranch Hand

Joined: May 16, 2000
Posts: 73
Thanks for your replies guys, but I found what I was doing wrong.
netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
No Gregg,even when the parent frame is mentioned the dialog is model only to the application.Dave, can u please tell me what was the mistake,for I too face the same problem.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I know that it is only modal to the Application. Dave metnioned that he had a Desktop with Internal Frames, hense, a JDesktop. I was under the impression that he meant HIS desktop, not the OS Desktop. In that case, setting it to the parent JFrame in the JDesktop Pane would solve his problem, if that was the mistake.
It would help if people who are posting these questions would be a little more specific in thier question. That way, there wouldn't be so much confusion in the answers.

------------------
Happy Coding,
Gregg Bolinger
 
Don't get me started about those stupid light bulbs.
 
subject: Dialog Always to front