How to add text area on JOptionPane

java_enthu picture java_enthu · Oct 14, 2011 · Viewed 29.1k times · Source

Currently I have a JOptionPane. On clicking a button I am executing following line.

JOptionPane.showInputDialog(this,"Enter your message","Messages",2);

It opens a popup with a text box. This text box accepts around 40/50 characters. In fact my requirement is to take long message (upto 300 characters) in this text box which is stopping this. So we want to come up with a text area on this input dialog? Is it possible how? Is there any better solution? Thanks in advance.

Answer

mKorbel picture mKorbel · Oct 14, 2011

official tutorial contains example for that, another examples here