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

BasicProgressBarUI has a typo in a L&F property

XMLWordPrintable

    • b03
    • x86
    • windows_xp
    • Verified

      FULL PRODUCT VERSION :
      java version "1.6.0-beta2"
      Java(TM) SE Runtime Environment (build 1.6.0-beta2-b84)
      Java HotSpot(TM) Client VM (build 1.6.0-beta2-b84, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      BasicProgressBarUI has a typo in a L&F property, "ProgressBarUI.vertictalSize"
      This bug is also on JSE 5.0


          protected Dimension getPreferredInnerVertical() {
              Dimension vertDim = (Dimension)DefaultLookup.get(progressBar, this,
                  "ProgressBar.vertictalSize");
              if (vertDim == null) {
                  vertDim = new Dimension(12, 146);
              }
              return vertDim;
          }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      A vertical JProgressBar of 40 pixels width and 200 pixels height should be drawed on the screen
      ACTUAL -
      The size of the JProgressBar never changes

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
         public void testIt() throws Exception
         {
            UIManager.put( "ProgressBar.verticalSize", new Dimension( 40, 200 ) );
            JProgressBar pb = new JProgressBar( 0, 100 );
            pb.setIndeterminate( true );
            pb.setStringPainted( true );
            pb.setOrientation( JProgressBar.VERTICAL );
            System.out.println(pb.getPreferredSize());
            
            FormLayout layout = new FormLayout( "1dlu:g, p, 1dlu:g", "1dlu:g, p, 1dlu:g" );
            PanelBuilder builder = new PanelBuilder( layout );
            CellConstraints cc = new CellConstraints();
            builder.add( pb, cc.xy( 2, 2 ) );
            JPanel p = builder.getPanel();

            JFrame f = new JFrame();
            f.getContentPane()
                  .add( p );
            f.pack();
            f.setVisible( true );
            Thread.sleep( 30000 );
         }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Subclassing BasicProgressBarUI to override "getPreferredInnerVertical()"

            mlapshin Mikhail Lapshin (Inactive)
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: