Results 1 to 6 of 6

Thread: dialog box

  1. #1
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default dialog box

    Is it possible to put two textfields in one dialog box? using JOptionPane.showInputDialog ???

    thanks :)
    Heart is the only broken thing that still works.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,572
    Rep Power
    25

    Default

    I'd have to read the API doc to tell you. Could you read it and save me the trouble?

  3. #3
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default

    Check out the Dialog Focus article.

  4. #4
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    I'd have to read the API doc to tell you. Could you read it and save me the trouble?
    a=Integer.parseInt (JOptionPane.showInputDialog(null,"1st number: ","find smallest",JOptionPane.PLAIN_MESSAGE)); //that will show a one dialog box with one textfield


    but I want 2 text filed in it...
    Heart is the only broken thing that still works.

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

    Default

    Did you check out Rob Camick's article that is linked to above? I think that it will provide a nice answer to your problem.

  6. #6
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    The long and short of it being that its doable, as JOptionPane lets you set the message as a JPanel (or other component). However, you do have to construct said panel yourself.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. About Dialog Modality...
    By vaibhavspawar in forum New To Java
    Replies: 1
    Last Post: 06-30-2010, 09:49 AM
  2. Dialog
    By JavaLerner in forum AWT / Swing
    Replies: 27
    Last Post: 07-07-2008, 11:29 AM
  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
  •