Here you can find the source of correctRowHeight(JTree tree)
Update tree row height to the best possible considering font size changes on the current platform http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4760081
Parameter | Description |
---|---|
table | a parameter |
public static void correctRowHeight(JTree tree)
//package com.java2s; //License from project: Open Source License import java.awt.FontMetrics; import javax.swing.JTable; import javax.swing.JTree; public class Main { /**/*from ww w. j av a 2 s .c o m*/ * Update table row height to the best possible considering font size changes on the current platform * * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4760081 * * @param table */ public static void correctRowHeight(JTable table) { // Fix tree row height FontMetrics metrics = table.getFontMetrics(table.getFont()); table.setRowHeight(Math.max(table.getRowHeight(), metrics.getHeight())); } /** * Update tree row height to the best possible considering font size changes on the current platform * * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4760081 * * @param table */ public static void correctRowHeight(JTree tree) { // Fix tree row height FontMetrics metrics = tree.getFontMetrics(tree.getFont()); tree.setRowHeight(Math.max(tree.getRowHeight(), metrics.getHeight())); } }