Discussion Locked

Java

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi all,
I have a Custom Window which is derived from JWindow , and from that window i am displaying another window(second window) which is also derived from JWindow in an action Event..How to make the second Window behave like a modal dialog
(all the inputs to the parent window must be stopped i.e the parent window must not execute further , only after getting the response from the second window the first window must proceed...) i am in a situation that i must not use a Dialog derived from JDialog...

8 replies

by duong beo

As far as I have concerned, the normal way is to derive the form from JDialog. All other class don't support the function as you are looking for.

One alternative solution is create a new class derive from JWindow and partly immitate the JDialog class but it may cause you a lot of thing to do, I don't know exactly. Can you give out the reason that makes you must not use a Dialog so we may find an other way?

Duong beo

by shankar

the reason why i cant use a jdialog is , i dont want the title bar and want it painted my self

by okujava

Hi,

u should call setEnabled(false) for your MainWindow object from the subWindow object as soon as subWindow is visible. then, when u close the subWindow, u should call setEnabled(true). notice, show() and setVisible() call setEnabled(true) automatically (i.e. u should call setEnabled(false) after the call of show()).

regards

by cedric king

Actually I wants to do what you are doing and I don't mind if it is a JDialog. The problem is that I can't really make it modal. Somehow I can manage to get access to the parent window and then be able to create another "About" window, which means Ican create lots of MODAL "About" window. Why?

This discussion is closed to new replies.