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

REGRESSION: AWT Choice height too small after font change (win32 ONLY)

XMLWordPrintable

    • x86
    • windows_nt



      Name: krT82822 Date: 10/20/99


      10/20/99 eval1127@eng -- as of kestrel-RA (1.3.0-I), this is reproducible on win32 (Solaris OK). This looks almost as though it's a regression re. bug # 4118928.
      If the setFont() is skipped, it works fine. Opening new bug, as I can't find any still-open bug that matches this problem. (4232545 may have been related, but was
      closed as "not a bug").

      /*
      The small class provided below demonstrates the problem I am
      experiencing: an AWT Choice control is not sized correctly with
      jdk 1.2.1, 1.2.2, or the 1.3 beta. It appears as expected for
      1.1.8 on Windows NT. I have not tested it on other platforms.
      The control seems to be useable (I can see the list posted),
      but is displayed only a few pixels tall.

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

      import java.awt.*;

      public class foo extends Frame
      {
         public foo()
         {
            setTitle("Foo");
            setFont( new Font("SansSerif", 12, Font.PLAIN) );
            setBackground( new Color(0xFC, 0xF8, 0xF5) );

            setLayout( new GridBagLayout() );

            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridx = gbc.gridy = 0;
            gbc.gridwidth = gbc.gridheight = 1;
            gbc.fill = GridBagConstraints.NONE;
            gbc.anchor = GridBagConstraints.EAST;
            gbc.weightx = gbc.weighty = 0;
            gbc.insets = new Insets(5, 5, 5, 5);

            Label lbl = new Label("Label:");
            add(lbl, gbc);

            gbc.gridx = 1;
            gbc.anchor = GridBagConstraints.WEST;
            gbc.fill = GridBagConstraints.VERTICAL;
            gbc.weighty = 0;
            Choice sys = new Choice();
            add(sys, gbc);

            sys.addItem("one");
            sys.addItem("two");
            sys.addItem("three");
            sys.addItem("four");
            sys.addItem("five");

            pack();
         }


         public static void main(String argv[])
         {
            foo bar = new foo();
            bar.setVisible(true);
         }
      }


      (Review ID: 96798)
      ======================================================================

            dassunw Das Das (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: