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

JDialog, JFrame, and JWindow shoud have setPreferredSize(Dimension)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • generic
    • generic



      Name: vi73552 Date: 03/17/99


      JComponent can have a preferred size set
      but none of JDialog, JFrame, and JWindow can.
      I suppose that the three should also be able to have
      preferred size set to be consistent with JComponent.

      There seems to be no workarounds other than overriding
      JDialog.getPreferredSize() to give JDialog a preferred size.

      ((JComponent)getContentPane()).setPreferredSize()
      doesn't take the title bar into account.

      setSize() after pack() works okay for most cases,
      but I suspect it causes unnecessary recomputation of geometries.
      (Review ID: 54933)
      ======================================================================

            rraysunw Richard Ray (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: