I'm using Nimbus L&F. I'm trying to change font size globally for all JTable by using the following code:
NimbusLookAndFeel nimbus = new NimbusLookAndFeel();
UIManager.setLookAndFeel(nimbus);
UIDefaults d = nimbus.getDefaults();
d.put("Table.font", new FontUIResource(new Font("SansSerif", Font.PLAIN, 18)));
It's working, all JTable's rows in the application are using the new font. I'm using bigger font size to make table more readable in large resolution.
But the problem is row height didn't changed, causing the font to be truncated. I've tried the following code:
d.put("Table.contentMargins", new Insets(50,50,50,50));
d.put("Table:\"Table.cellRenderer\".contentMargins", new Insets(50,50,50,50));
But it didn't change anything in the displayed tables.
Can I change row height globally without calling setRowHeight()
for each JTable's instance?