JDK-8003400 : JTree scrolling problem when using large model in WindowsLookAndFeel.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u4
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-11-14
  • Updated: 2013-08-15
  • Resolved: 2013-01-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40 b12Fixed 8Fixed
Related Reports
Relates :  
Description
 When JTree.setLargeModel(true) is being used then horizontal scroll bar appears as needed when scrolling the tree vertically. If currently visible tree rows are short enough then horizontal scrollbar disappears. If at least one visible row is too wide horizontal scroll bar pops in.

However this mechanism is broken if the last tree row is too long to fit visible area and all other rows are short enough to show without scrollbar. See the third JTree screenshot in the attachment - only the very last tree row is too long. Now if the tree is resized vertical scrollbar will show - as in picture A. Pressing End key to move selection to the last tree row will scroll the tree down. But since the last row is too long the horizontal scrollbar will show. However it will take some of the vertical space - see picture B. At this point clicking 'down' button on the vertical scrollbar does nothing. Also the horizontal scrollbar stays at same position when being manipulated by mouse.

See also this NetBeans issue: http://netbeans.org/bugzilla/show_bug.cgi?id=219709
Comments
http://cr.openjdk.java.net/~malenkov/8003400.3/
24-01-2013

The sample uses WindowsLookAndFeel Steps to reproduces: - run the attached TreeLargeModel class - select the root node - press End key The last tree path is not visible
14-01-2013

According to the NetBeans bug http://netbeans.org/bugzilla/show_bug.cgi?id=214005 the issue is reproduced on the JDK 1.7.0_04-b20
26-11-2012