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

JScrollBar track has incorrect color for Windows LAF

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.8
    • client-libs



      Name: krT82822 Date: 07/08/99


      7/8/99 kevin.ryan@eng -- case filed against 1.1.7a, but problem exists in both Swing 1.1.1 beta2 (with 1.1.8) and in JDK 1.2.2 RC1.
      Thought we had a duplicate bug, but couldn't find it.]

      Starting with Swing 1.1 (beta) the scrollbar track
      displayed by JScrollBar has the incorrect color
      for the Windows LAF. Prior to that Swing release
      (e.g. 1.0.3), it was colored a lighter gray
      (RGB 224,224,224) than the default background
      (RGB 192,192,192). Subsequent to that release,
      it has the same color as the default background.
      This is not consistent with the appearance of
      native Windows applications.

      This code reproduces the problem. For Swing 1.0.3,
      the scrollbar track appears light gray, while for
      Swing 1.1, it appears a darker gray.

      import java.awt.*;
      import java.awt.event.*;
      import com.sun.java.swing.*;

      public class ScrollBarTest
      {
          public static void main (String args[])
          {
              try {
                  UIManager.setLookAndFeel ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              }
              catch (Exception e) {
                  e.printStackTrace ();
                  System.exit (1);
              }

              JFrame frame = new JFrame ("ScrollBar Test");
              frame.addWindowListener (new WindowAdapter () {
                  public void windowClosing (WindowEvent event) {
                      System.exit (0);
                  }
              } );

              JScrollBar scrollBar = new JScrollBar (Scrollbar.HORIZONTAL);
              frame.getContentPane ().add (scrollBar, "South");
              frame.pack ();
              frame.setSize (400, 300);
              frame.show ();
          }
      }
      (Review ID: 41725)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: