JDK-8134882 : Scrollbar thumb disappears in Nimbus look and feel
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u60,8u66,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux_ubuntu
  • CPU: x86_64
  • Submitted: 2015-08-29
  • Updated: 2015-09-01
  • Resolved: 2015-09-01
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux marvin 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


A DESCRIPTION OF THE PROBLEM :
When using Nimbus look and feel, the scrollbar thumb disappears if its size gets below approximately 24 pixels.
 

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Resize any scrollbar so that the thumb becomes small.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The scrollbar thumb should remain visible, at a reasonable minimum size.
ACTUAL -
The scrollbar thumb disappears once it reaches approximately 24 pixels.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;

public class ScrollTest {
    public static void main(String[] args) throws Exception {
        for (UIManager.LookAndFeelInfo info :
		 UIManager.getInstalledLookAndFeels()) {
            if (info.getName().startsWith("Nimbus")) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }

        final JFrame frame = new
	    JFrame(ScrollTest.class.getSimpleName());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JTextArea textArea = new JTextArea();
        textArea.setColumns(80);
        textArea.setRows(40);
	textArea.setFont(new java.awt.Font("Monospaced", 0, 12));

        final JScrollPane scrollPane = new JScrollPane(textArea);
        scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
        scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
        frame.getContentPane().add(scrollPane);
        frame.pack();
        frame.setVisible(true);
    }
}

---------- END SOURCE ----------


Comments
Run the attached test case (ScrollTest.java) in Windows 7 (64-bit) Checked this for JDK 7u85, 8u51, 8u60, 9 ea b78. Result: ========== 7u85: OK 8u51: OK 8u60: FAIL 8u66 ea b02: FAIL 9 ea b78: FAIL Steps to reproduce: =============== 1. Compile and run the attached program 2. Resize the window to make it smaller. 3. The vertical scrollbar disappears close to 24 pixels as reported by the submitter when checked with 8u60, 8u66 ea b02, and 9 ea b78. This is a regression in 8u60, 8u66 ea b02, and 9 ea b78 as checked. Further, this looks like a duplicate of JDK-8134827.
01-09-2015