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

BasicComboBoxUI getXXXXsize methods returns wrong values

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description



      Name: nkR10003 Date: 07/17/2000


      getXXXXsize methods (see list below) in class MetalFileChooser
      returns different values from one invocation to another. The program
      below demonstrates this.

      methods list:
          public Dimension getPreferredSize(JComponent c)
          public Dimension getMaximumSize(JComponent c)
          public Dimension getMinimumSize(JComponent c)

      %java -fullversion
      java full version "1.4.0beta-b22"
      ------------------example--------------------
      //ComboBoxExample.java
      //
      import javax.swing.*;
      import javax.swing.plaf.basic.*;
      import java.lang.reflect.*;
      public class ComboBoxExample {
          
          public static void main(String[] args) {
              try {
                  SwingUtilities.invokeAndWait(new Runnable() {
                      public synchronized void run() {
                          BasicComboBoxUI ui = new BasicComboBoxUI();
                          final JComboBox comboBox = new JComboBox();
                          comboBox.setUI(ui);
                          System.out.println("MinimumSize: "
                                  + comboBox.getUI().getMinimumSize(comboBox));
                          System.out.println("MaximumnSize: "
                                  + comboBox.getUI().getMaximumSize(comboBox));
                          System.out.println("PreferredSize: "
                                  + comboBox.getUI().getPreferredSize(comboBox));
                          System.out.println("================================"
                                  +"========================");
                          System.out.println("MinimumSize: "
                                  + comboBox.getUI().getMinimumSize(comboBox));
                          System.out.println("MaximumnSize: "
                                  + comboBox.getUI().getMaximumSize(comboBox));
                          System.out.println("PreferredSize: "
                                  + comboBox.getUI().getPreferredSize(comboBox));
                      }
                  });
              } catch (InterruptedException ie) {
                  ie.printStackTrace();
              } catch (InvocationTargetException ite) {
                  ite.printStackTrace();
              }
              System.exit(0);
          }
      }
      ----------------output:----------------------
      MinimumSize: java.awt.Dimension[width=24,height=19]
      MaximumnSize: java.awt.Dimension[width=32767,height=23]
      PreferredSize: java.awt.Dimension[width=32771,height=27]
      ========================================================
      MinimumSize: java.awt.Dimension[width=32771,height=27]
      MaximumnSize: java.awt.Dimension[width=32767,height=31]
      PreferredSize: java.awt.Dimension[width=32771,height=35]
      ---------------------------------------------
      The values in first three lines of output is rather different then others.

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              mdavidsosunw Mark Davidson (Inactive)
              Reporter:
              knasunw Kna Kna (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: