1

JOptionPane.showMessageDialog(this, "short message", "Title has to be very longer than text, so long that title is cropped.", JOptionPane.ERROR_MESSAGE);

use null instead of this if u are testing directly in main method.

As written in the above code , if joptionpane title is larger than message it gets cropped ? is there a way to set its size ?

I could not post its screenshot . Run the single line of code in your main function

  • `String txt= "ur text "; JTextArea jtextobject= new JTextArea(txt); JOptionPane.showMessageDialog( null, jtextobject, "Not Truncated!", JOptionPane.ERROR_MESSAGE);` – JBALI Jan 21 '15 at 09:27
  • 1
    @user3624028 this helps when a message is large. Unfortunately my title is larger than the message content itself. – Praveen Balan Jan 21 '15 at 09:34

0 Answers0