-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.2
-
generic
-
generic
Name: krT82822 Date: 08/03/99
The symptoms can be reproduced easily with
http://java.sun.com/docs/books/tutorial/uiswing/components/example-swing/TreeDemo.java
Basically, when a JTree inside a JScrollPane is smaller than the viewport of the scrollpane then PageUp/PageDown keys cause a wierd redraw effect. The JTree appears to be shrunk to its actual size and is moved such its bottom edge touches the bottom edge of the JScrollPane (the gap between the two top edges is also rendered differently - in gray).
Expanding or shrinking nodes, followed by further PageUp/PageDown keypresses further confuses the positioning of the JTree.
It can be demonstrated that it's the JScrollPane that's responsible by making the following change to the above example:
replace:
//Create the scroll pane and add the tree to it.
JScrollPane treeView = new JScrollPane(tree);
with:
javax.swing.JPanel treeView = new javax.swing.JPanel() ;
treeView.setLayout( new java.awt.BorderLayout( 0, 0 )) ;
treeView.add( tree, java.awt.BorderLayout.CENTER ) ;
The behaviour then goes away.
This appears to have been introduced in jdk1.2.2 - its not reproducable with jdk1.2.1 (I don't recall noticing it with jdk1.2.2RC1 either).
(Review ID: 93379)
======================================================================
- duplicates
-
JDK-4217252 JViewport.scrollRectToVisible allows scrolling beyond bounds of component
-
- Resolved
-