Results 1 to 2 of 2
  1. #1
    romina is offline Member
    Join Date
    Jul 2007
    Posts
    26
    Rep Power
    0

    Default Problem with JOptionPane.showInputDialog()

    When I use JOptionPane.showInputDialog() the input dialog pops up behind any other windows on the screen at the time.
    Anyone know how to fix that?

    Java Code:
            String list[] = {"100","400","900","1600"};
            String value = null;
    
            while(value == null)
            {
                value = (String)JOptionPane.showInputDialog(null,"How many cells do you want?",
                    "John Conway's Game Of Life",JOptionPane.INFORMATION_MESSAGE,null,list,list[1]);
                    
                if (value == null)
                    JOptionPane.showMessageDialog(null,"You must choose a number.",
                        "ERROR",JOptionPane.ERROR_MESSAGE);
            }
    This is the section of code that the input dialog is in. Do you think that it could possibly have something to do with the IDE?
    Thanks

  2. #2
    barney is offline Member
    Join Date
    Jul 2007
    Posts
    40
    Rep Power
    0

    Default

    I need to create an InputDialog using JOptionPane with two input fields an a large information message. How can I do this? Or may be it's better to create a JDialog?
    Sounds like you will be using a JFrame or JPanel. Have you worked with either of these yet? The input won't be hard once you get the actual window working.

Similar Threads

  1. JOptionPane (customizing)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-14-2008, 12:39 PM
  2. JOptionPane - input dialog
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-17-2007, 10:09 AM
  3. About JOptionPane.showMessageDialog
    By jhetfield18 in forum AWT / Swing
    Replies: 2
    Last Post: 11-02-2007, 11:45 PM
  4. About JOptionPane.showMessageDialog
    By jhetfield18 in forum Advanced Java
    Replies: 0
    Last Post: 11-02-2007, 11:56 AM
  5. problems with JOptionPane
    By oregon in forum AWT / Swing
    Replies: 2
    Last Post: 08-05-2007, 06:58 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
  •