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

Minimum size for java.awt.Frame is not being enforced.

XMLWordPrintable

    • b51
    • generic, x86
    • generic, linux_redhat_8.0, windows_nt, windows_xp

      Name: krT82822 Date: 03/08/2000


      8 Mar 2000, eval1127@eng -- easily worked around. Could not find any still-open
      bugs re. this, so am filing new one.

      java version "1.2.2"
      Classic VM (build JDK-1.2.2-W, native threads, symcjit)

      Since there is no method to set a minimum size on a java.awt.Frame, the most
      obvious way to control this behavior is to extend the Frame object and override
      the getMinimumSize() method. However, when this is done, the minimum size that
      I set is not being enforced. Any other suggestions?

      Sample code as follows:
      -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

      import java.awt.*;

      public class ResizeTest extends Frame
      {
         private final Dimension m_dim = new Dimension(200, 150);

         public static void main(String args[])
         {
            new ResizeTest("Resize Test");
         }

         public ResizeTest(String title)
         {
            super(title);
            setLayout(new BorderLayout());
            setSize(m_dim);
            show();
         }

         public Dimension getPreferredSize() { return m_dim; }
         public Dimension getMinimumSize() { return m_dim; }
      }
      (Review ID: 102158)
      ======================================================================

            vbaranovsunw Vyacheslav Baranov (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: