United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8003400 JTree scrolling problem when using large model in WindowsLookAndFeel.
JDK-8003400 : JTree scrolling problem when using large model in WindowsLookAndFeel.

Details
Type:
Bug
Submit Date:
2012-11-14
Status:
Resolved
Updated Date:
2013-07-29
Project Name:
JDK
Resolved Date:
2013-01-25
Component:
client-libs
OS:
Sub-Component:
javax.swing
CPU:
Priority:
P4
Resolution:
Fixed
Affected Versions:
7u4
Fixed Versions:
7u40 (master)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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
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
                                     
2012-11-26
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
                                     
2013-01-14
http://cr.openjdk.java.net/~malenkov/8003400.3/
                                     
2013-01-24
URL:   http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/c067e1ad8778
User:  malenkov
Date:  2013-01-25 17:10:24 +0000

                                     
2013-01-25
URL:   http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/c067e1ad8778
User:  lana
Date:  2013-02-11 18:23:50 +0000

                                     
2013-02-11



Hardware and Software, Engineered to Work Together