Dialog in Java.. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Dialog in Java..

sxb3131sxb3131 Posts: 5Member
Does any body know how to create a modal dialog in
java using swing. I have the code done but it has
a problem.

Problem Description:
--------------------
When the dialog is popped up, I access other windows and this
dialog and the actual window are hidden beneath them. Now I
click on the icon at the bottom of the screen for the actual
window which created this dialog. Now the dialog is not shown
on the screen and I cannot do anything with the main window.
Looks to the customer like this window is dead. Only option
I have is to do ALT-TAB to browse through all the windows and
go to the java icon which is not shown on the bottom of the screen.

Let me know if there is a remedy or workaround for this problem.

The code for dialog:
--------------------
JOptionPane.showConfirmDialog(this,
(String) message,
(String) title),
JOptionPane.OK_CANCEL_OPTION ,
JOptionPane.WARNING_MESSAGE);

Let me know if there are any solutions for this problem..
Thanks
sxb3131..

Comments

  • beancounterbeancounter Posts: 88Member
    Sun doesn't recommend using JOptionPane for a modal dialog box.

    Check this link for their solution...

    http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

    Hope this helps you out.

    Ken

    Does any body know how to create a modal dialog in
    : java using swing. I have the code done but it has
    : a problem.
    :
    : Problem Description:
    : --------------------
    : When the dialog is popped up, I access other windows and this
    : dialog and the actual window are hidden beneath them. Now I
    : click on the icon at the bottom of the screen for the actual
    : window which created this dialog. Now the dialog is not shown
    : on the screen and I cannot do anything with the main window.
    : Looks to the customer like this window is dead. Only option
    : I have is to do ALT-TAB to browse through all the windows and
    : go to the java icon which is not shown on the bottom of the screen.
    :
    : Let me know if there is a remedy or workaround for this problem.
    :
    : The code for dialog:
    : --------------------
    : JOptionPane.showConfirmDialog(this,
    : (String) message,
    : (String) title),
    : JOptionPane.OK_CANCEL_OPTION ,
    : JOptionPane.WARNING_MESSAGE);
    :
    : Let me know if there are any solutions for this problem..
    : Thanks
    : sxb3131..
    :

  • sxb3131sxb3131 Posts: 5Member
    I tried this link in sun website already a couple of times and it
    does not help me whatsoever.

    Is there any way of having a JDialog stay on top of the current
    window always until the user chooses an option in the dialog.
    Let me know. I have been dealing with this problem for quite
    some time and I am pissed off with this junk.

    Let me know if you have any pointers.

    Thanks in advance..
    sxb3131

    : Sun doesn't recommend using JOptionPane for a modal dialog box.
    :
    : Check this link for their solution...
    :
    : http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
    :
    : Hope this helps you out.
    :
    : Ken
    :
    : Does any body know how to create a modal dialog in
    : : java using swing. I have the code done but it has
    : : a problem.
    : :
    : : Problem Description:
    : : --------------------
    : : When the dialog is popped up, I access other windows and this
    : : dialog and the actual window are hidden beneath them. Now I
    : : click on the icon at the bottom of the screen for the actual
    : : window which created this dialog. Now the dialog is not shown
    : : on the screen and I cannot do anything with the main window.
    : : Looks to the customer like this window is dead. Only option
    : : I have is to do ALT-TAB to browse through all the windows and
    : : go to the java icon which is not shown on the bottom of the screen.
    : :
    : : Let me know if there is a remedy or workaround for this problem.
    : :
    : : The code for dialog:
    : : --------------------
    : : JOptionPane.showConfirmDialog(this,
    : : (String) message,
    : : (String) title),
    : : JOptionPane.OK_CANCEL_OPTION ,
    : : JOptionPane.WARNING_MESSAGE);
    : :
    : : Let me know if there are any solutions for this problem..
    : : Thanks
    : : sxb3131..
    : :
    :
    :

Sign In or Register to comment.