Here you can find the source of correctRowHeight(JTable table)
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
Parameter | Description |
---|---|
table | a parameter |
public static void correctRowHeight(JTable table)
//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 w w w. j av a 2 s . co 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())); } }