This content has been marked as final. Show 5 replies
Yes, after changing the font I've tried this:
FontMetrics fontMetrics = label.getFontMetrics(label.getFont()); Dimension d = new Dimension(fontMetrics.stringWidth(value.toString()), fontMetrics .getHeight()); tree.setRowHeight(d.height); label.setSize(d);
The problem results from
- bolding the font increases the rendering components pref size
- tree doing lots of size caching
the way out to make the tree aware of the fact that something changed. That's done - as always :-) by making the model notify the tree about the change. F.i. regard the "checked" as an observable property of your node (or userObject) and fire a nodeChanged on the model.