Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. private void updateRowHeights()
  2. {
  3. for (int row = 0; row < table.getRowCount(); row++)
  4. {
  5. int rowHeight = table.getRowHeight();
  6.  
  7. for (int column = 0; column < table.getColumnCount(); column++)
  8. {
  9. Component comp = table.prepareRenderer(table.getCellRenderer(row, column), row, column);
  10. rowHeight = Math.max(rowHeight, comp.getPreferredSize().height);
  11. }
  12.  
  13. table.setRowHeight(row, rowHeight);
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement