By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,106 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Modal dialog is hidden by parent Frame component

P: n/a
Hi,
I am writing an application with a JFrame as the main window and
several dialogs to gain user input. The problem arises when another
window (from a differnent apllication) hides my applications window
(while one of the (modal) dialogs is currently showing). When my
applications window reappears again the dialog is no longer showing. I
have to iconify the other applications window in order to make the
dialog reappear again.

What do I have to do tell Java that I want my dialog to be visible
after the application becomes visible again?

Thanks in advance for yout help.
Bjoern
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Liz
((JDialog)p3).toFront();

"Bjoern Obermeyer" <bj**************@gmx.de> wrote in message
news:32**************************@posting.google.c om...
Hi,
I am writing an application with a JFrame as the main window and
several dialogs to gain user input. The problem arises when another
window (from a differnent apllication) hides my applications window
(while one of the (modal) dialogs is currently showing). When my
applications window reappears again the dialog is no longer showing. I
have to iconify the other applications window in order to make the
dialog reappear again.

What do I have to do tell Java that I want my dialog to be visible
after the application becomes visible again?

Thanks in advance for yout help.
Bjoern

Jul 17 '05 #2

P: n/a
Bjoern Obermeyer wrote:
Hi,
I am writing an application with a JFrame as the main window and
several dialogs to gain user input. The problem arises when another
window (from a differnent apllication) hides my applications window
(while one of the (modal) dialogs is currently showing). When my
applications window reappears again the dialog is no longer showing. I
have to iconify the other applications window in order to make the
dialog reappear again.

What do I have to do tell Java that I want my dialog to be visible
after the application becomes visible again?

Thanks in advance for yout help.
Bjoern


hi,
I pass the JFrame object into the dialogs to solve it, like

public class MyDialog extends JDialog {

public MyDialog(Frame parent, boolean modal, .....) {

super(parent, modal);
.......
}

.........
}

and,
.....
JFrame frame = ........
.....
MyDialog md = new MyDialog(frame, true, .......);
md.show();

try it and good luck.

:)
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.