Closed tuzzo77 closed 2 years ago
You can use the following properties to add the grid lines to a table:
UIManager.put("Table.showHorizontalLines", true); UIManager.put("Table.showVerticalLines", true); UIManager.put("Table.showTrailingVerticalLine", false);
Thanks for the reply. I solved adding explicitally setShowGrid(true) in my JXTable object. Probably it was ovrerrided by new Look and Feel.
Here is the documentation for the available UI properties: https://www.formdev.com/flatlaf/components/table/
UIManager.put("Table.showGrid", true);
does not work because that UI property does not exist.
As @hclerx noted, you have to set Table.showHorizontalLines
and Table.showVerticalLines
.
If you need grid lines only on some tables, use JTable.setShowGrid(true)
.
Hi, I have some problem trying to display grid line in my JTable, after using FlatLightLaf or FlatDarkLaf. In my project I'm using JXTable of Swingx, also if I use this code I cannot display gridline in any Jtable. Can anyone help me please? Thanks
UIManager.setLookAndFeel(new FlatDarkLaf() ); UIManager.put("Table.gridColor", Theme.LIGHT_GRAY); UIManager.put("Table.disabled", false); UIManager.put("Table.showGrid", true); UIManager.put("Table.intercellSpacing", new Dimension(1, 1));