Results 1 to 2 of 2
  1. #1
    e1luca is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default MessageDialog within a Dialog

    hi. pls a bit of help:
    I have a messagedialog pop up from within another Dialog. Nice, but when OK is pressed in this new messagedialog, the original Dialog dissapears and focus goes to the main window (frame). How can I make it return to the initial Dialog?

    Java Code:
          public JView(SingleFrameApplication app){
           (...)
           jMyDialog = new javax.swing.JDialog();// frame JView has jMyDialog pop up and user make some choices
           (...)
           jMyDialog.addComponent(jButtonDiagConfirme);//jMyDialog has a button jButtonDiagConfirme to confirme the choices
            
           void SomeMethod(){
           jMyDialog.setVisible()//pop up jMyDialog
           }
            
           //when jButtonDiagConfirme is pressed in jMyDialog another dialog pops up
           private void jButtonDiagConfirmeActionPerformed(java.awt.event.ActionEvent evt){
           (...)
           if (someCondition<0) {JOptionPane.showMessageDialog(frame, "You made wrong choices, return to jMyDialog");}//this is the dialog "within" the jMyDialog
          }
    
     }

  2. #2
    e1luca is offline Member
    Join Date
    Mar 2009
    Posts
    3
    Rep Power
    0

    Default

    anyone?
    Let me refraze:

    JDialogChoices has a JButton "Done" that pops up JDialog2.
    JDialog2 has message "Wrong Choice" and "OK" button.
    After "OK" both JDialogChoices and JDialog2 are closed. I want JDialogChoices to stay open for the user to correct the choices made.

Similar Threads

  1. InputDialog & MessageDialog HELP?!
    By Frög in forum New To Java
    Replies: 7
    Last Post: 02-26-2009, 05:41 AM
  2. JFace's MessageDialog Demonstration
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 04:39 PM
  3. Example of SWT Dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-09-2008, 12:01 PM
  4. Dialog Box
    By uncopywritable in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 12:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •