• Post Reply Bookmark Topic Watch Topic
  • New Topic

JOptionPane with Multiple InputText boxes  RSS feed

 
Faraz Alig
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21094
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rob Camick
Ranch Hand
Posts: 2801
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may also be interested in the Dialog Focus tip.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Aspirant wrote:

Please check your private messages for an important administrative matter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!