Joptionpane showinputdialog textarea

Joptionpane showinputdialog textarea

Posted: TESTTEST Date: 29.06.2017

It opens a popup with a text box. In fact my requirement is to take long message upto 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?

Put a JTextArea into JOptionPane. While I'm not sure whether using the JOptionPane is the best option for the purpose, you can add a text area, or any other form component into an OptionPane. Since you have asked specifically for a TextArea, I have added a JTextField and a JTextArea in the following example.

However, I suggest its better you use a JDialog instead of the JOptionPane for complex input forms like these. By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us.

Log In Sign Up. Join the Stack Overflow Community. Stack Overflow is a community of 7.

Adding a JTextArea in a JOptionPane showMessageDialog | ReadWriteLiveLove

Join them; it only takes a minute: How to add text area on JOptionPane Ask Question. Currently I have a JOptionPane.

On clicking a button I am executing following line. Use the defined constants instead. This example may help you refine your question. Good links; tag updated.

java - How to add text area on JOptionPane - Stack Overflow

Andrew Thompson k 21 Answer edited to use a confirmation dialog. I created JTextArea object, and added to the JOptionPane. Where as I want the text which is entered by the user. WEST, lblName, 0, SpringLayout. WEST, panel ; layout.

NORTH, lblAddress, 10, SpringLayout. SOUTH, lblName ; layout. WEST, txtName, 25, SpringLayout. EAST, lblName ; layout. NORTH, scrollPane, 10, SpringLayout. Sampath 1 7 Sign up or log in StackExchange. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name.

Stack Overflow works best with JavaScript enabled. Don't use 'magic numbers' e. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

inserted by FC2 system