-
Bug
-
Resolution: Fixed
-
P4
-
1.2.0
-
swing1.1
-
sparc
-
solaris_2.6
-
Verified
The JScrollpane that the JTree is in scrolls JTree to the left after expanding hiding the root node dot. This occurs with JDK1.1.6 and swing-1.0.2 on Solaris 2.6.
Steps to Reproduce:
0) Run the code below with the configuration above.
1) Note the very first view of the tree.
2) Collapse the tree.
3) Expand the tree.
RESULT: The expanded tree looks different than it orignally did. The scrollpane has scrolled the root's dot to the left and its not visible.
import com.sun.java.swing.*;
import java.awt.*;
import java.awt.event.*;
public class jtreeroot extends JApplet {
public void init() {
Container contentPane = getContentPane();
Object[] objectsForNodes = new Object[] {
new JLabel("foo"), "bar"
};
JTree tree = new JTree(objectsForNodes);
JScrollPane scrollPane = new JScrollPane(tree);
scrollPane.setPreferredSize(new Dimension(150,100));
tree.setRootVisible(true);
contentPane.setLayout(new FlowLayout());
contentPane.add(scrollPane);
}
}
Steps to Reproduce:
0) Run the code below with the configuration above.
1) Note the very first view of the tree.
2) Collapse the tree.
3) Expand the tree.
RESULT: The expanded tree looks different than it orignally did. The scrollpane has scrolled the root's dot to the left and its not visible.
import com.sun.java.swing.*;
import java.awt.*;
import java.awt.event.*;
public class jtreeroot extends JApplet {
public void init() {
Container contentPane = getContentPane();
Object[] objectsForNodes = new Object[] {
new JLabel("foo"), "bar"
};
JTree tree = new JTree(objectsForNodes);
JScrollPane scrollPane = new JScrollPane(tree);
scrollPane.setPreferredSize(new Dimension(150,100));
tree.setRootVisible(true);
contentPane.setLayout(new FlowLayout());
contentPane.add(scrollPane);
}
}