I have a Java swing application, I want to set to all JTable
of my application a fixed RowHeight.
So I have insert this line of code:
UIManager.put("JTable.rowHeight", 25);
But this code not works.
I have a Java swing application, I want to set to all JTable
of my application a fixed RowHeight.
So I have insert this line of code:
UIManager.put("JTable.rowHeight", 25);
But this code not works.
Try these codes
UIDefaults jDefaults = UIManager.getLookAndFeelDefaults();
//change nimbusL&F Selection Background color
jDefaults.put("Table.rowHeight", new Integer(25));
//update ui trees
for(Window window : Window.getWindows()){
SwingUtilities.updateComponentTreeUI(window);
}
or
UIManager.put("Table.rowHeight", 25);
I want to set to all JTable of my application a fixed RowHeight.
There is no UIManager property. You can't just make up properties and expect it to work.
Check out UIManager Defaults for an application that will list the actual properties that you might be able to modify for a given LAF.
If you want to set the row height you need to do it for every table:
JTable table = new JTable(...);
table.setRowHeight( 25 );