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

Regression: java.awt.Choice is taller than it should be

    XMLWordPrintable

Details

    • 1.1.6
    • x86
    • windows_nt
    • Verified

    Backports

      Description



        Name: eyC74480 Date: 03/31/98


        The Choice component is much taller than it claims to be. The preferred size is 21 pixels, so layout managers treat it as such and set the compoent's bounds accordingly but when the peer is created it's closer to 28 pixels high. This results in clipping and overlapping components when positioned by most layout managers.

        The problem seems to have been introduced in the peer code by a fix requested by Netscape.

        The following example illustrates the problem using GridBagLayout:

        -- CUT HERE --
        import java.awt.*;

        public class ChoiceFrame extends Frame {
          public static void main(String args[]) {
            Frame f = new ChoiceFrame();
            GridBagConstraints gbc = new GridBagConstraints();

            f.setLayout(new GridBagLayout());
            gbc.gridy = 1;
            f.add(new Button("I shouldn't be overlapping!"), gbc);
            gbc.gridy = 0;
            f.add(new Choice(), gbc);
            f.pack();
            f.show();
          }
        }
        -- CUT HERE --
        (Review ID: 27504)
        ======================================================================

        Attachments

          Issue Links

            Activity

              People

                dmendenhsunw David Mendenhall (Inactive)
                eyusunw Ellis Yu (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: