-
Bug
-
Resolution: Not an Issue
-
P4
-
None
-
1.2.0
-
generic
-
generic
Name: krT82822 Date: 01/18/99
Changing the font of the tree cell renderer does not invalidate the UI's cached preferred sizes. All the cells come up with ...'s because the new size
is larger (assuming a larger font)
import javax.swing.*;
import javax.swing.tree.*;
import java.awt.*;
import java.util.*;
public class TreeChangedRenderer {
public static void main(String args[]) {
JFrame frame = new JFrame("Changed Renderer");
JTree tree = new JTree();
DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer)tree.getCellRenderer();
renderer.setFont(new Font("Dialog", Font.BOLD | Font.ITALIC, 24));
JScrollPane scrollPane = new JScrollPane(tree);
frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
frame.setSize(300, 150);
frame.setVisible(true);
}
}
(Review ID: 52780)
======================================================================