Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4545951

JOptionPane.showMessageDialog does not size dialog properly

XMLWordPrintable



      Name: rmT116609 Date: 12/03/2001


      java version "1.4.0-beta3"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
      Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

      also

      java version "1.3.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
      Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

      JOptionPane.showMessageDialog() does not properly size the dialog to fit all
      its contents. The OK button is pushed off the bottom of the dialog.

      Here is a test cases using a JTextArea for the message component. The JTextArea
      is properly sized, but the dialog is not any taller and so the OK button almost
      disappears.

      import javax.swing.*;
      public class OptTest {
      public static void main(String args[]) {
      JTextArea msg = new JTextArea("one two three four five six"+
      "seven eight nine ten one two three four five six seven eight nine ten one two"+
      "three four five six seven eight nine ten one two three four five six seven"+
      "eight nine ten one two three four five six seven eight nine ten one two three"+
      "four five six seven eight nine ten", 0, 40);
      msg.setLineWrap(true);
      JOptionPane.showMessageDialog(null, msg);
      System.exit(0);
      }
      }
      (Review ID: 136681)
      ======================================================================

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: