Results 1 to 5 of 5
  1. #1
    aibao is offline Member
    Join Date
    May 2011
    Posts
    4
    Rep Power
    0

    Default JOptionPane - Message dialog box does not display

    Good morning everyone.
    Can someone please help me figure out the bug in my code,
    No error message has been displayed to the output, but my message box won't display. :

    Java Code:
    ...
    
      try {
    
                if(this.isEdit) {
    
                    System.out.println("edited!");
                    empService.editEmployee(editedEmployee);
    
                    this.setVisible(false);
                    empList = new ViewEmployeeList();
                    empList.setVisible(true);
                     
                    JOptionPane.showMessageDialog(this, "You have successfully "
                                + "edited the employee's information.", "Success", JOptionPane.INFORMATION_MESSAGE);
                } else {
                    System.out.println("added!");
                    empService.addEmployee(editedEmployee);
                    JOptionPane.showMessageDialog(this, "You have successfully "
                                + "saved the employee's information.", "Success", JOptionPane.INFORMATION_MESSAGE);
                }
    
            }catch(ErrorException e){
                e.toString();
            }
    ...

    Thank you!
    Last edited by Fubarable; 05-01-2011 at 03:36 AM.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I can't see that the error is coming from the code you've posted above and suspect that your bug is elsewhere. Consider creating and posting an SSCCE

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,193
    Rep Power
    19

    Default

    To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

    Use code tags to post codes -- [code]CODE[/code] will display as
    Java Code:
    CODE
    db

    edit 3 minutes late again! I hate power cuts!

  4. #4
    aibao is offline Member
    Join Date
    May 2011
    Posts
    4
    Rep Power
    0

    Default

    Hello Fubarable and DarrylBurke!
    Thank you for the advices on putting on an SSCCE code on the post. I'm sorry I didn't get to do that, because I was already able to figure out the error on my code.

    You are right Fubarable, it isn't really in the code I published. Pardon for that.
    I found out I have an sqlexception in the
    Java Code:
     empService.editEmployee(editedEmployee);
    part.

    NOthing's really wrong with my JOptionPane. sorry!

    Thanks for the effort to reply. GOD bless.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Replies: 13
    Last Post: 03-20-2010, 01:03 AM
  2. Default Focus in JOptionPane Dialog
    By Gajesh Tripathi in forum AWT / Swing
    Replies: 5
    Last Post: 11-11-2009, 02:59 PM
  3. JOptionPane dialog (Localizing)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-14-2008, 11:36 AM
  4. JOptionPane - message dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 09:11 AM
  5. JOptionPane - input dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 09:09 AM

Posting Permissions

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