File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes JOptionPane with Multiple InputText boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JOptionPane with Multiple InputText boxes" Watch "JOptionPane with Multiple InputText boxes" New topic
Author

JOptionPane with Multiple InputText boxes

Faraz Alig
Greenhorn

Joined: Mar 14, 2010
Posts: 24
Hi Java Guru's,


As per the requirement I have to use a single JOptionPane with three input textboxes for taking three inputs.
Kindly help me how to do that.

Thanks in advance..
Java Aspirant
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18365

The message parameter of JOptionPane's showXXX methods can take any object. Usually you use a String or String array, but you can provide complete Swing controls. In your case, it's as simple as this:
You can of course change the JPanel's layout manager to something more suitable, but this is just for showing how it's done.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1652
You may also be interested in the Dialog Focus tip.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7602

Java Aspirant wrote:

Please check your private messages for an important administrative matter


[Donate a pint, save a life!] [How to ask questions]
 
 
subject: JOptionPane with Multiple InputText boxes
 
Threads others viewed
Timers and Message Boxes
java alert
The method showMessageDialog(Component, Object) in the type JOptionPane is not applic
How to build the MDI JFrame?
JOptionPane -> YES_NO Dialog Problem
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com