-
-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customization of table in flatlaf #780
Comments
Can anyone help on this please. |
My solution is custom table cell render. I not sure the flatlaf have the properties style table.setShowVerticalLines(true);
applyStye(table, 0); private void applyStye(JTable table, int colIndex) {
final TableCellRenderer oldCellRender = table.getDefaultRenderer(Boolean.class);
table.getColumnModel().getColumn(colIndex).setCellRenderer(new DefaultTableCellRenderer() {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component com = oldCellRender.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (isSelected) {
com.setBackground(UIManager.getColor("Table.selectionBackground"));
} else {
if (row % 2 != 0) {
com.setBackground(UIManager.getColor("Table.alternateRowColor"));
} else {
com.setBackground(UIManager.getColor("Table.background"));
}
}
return com;
}
});
} Here My Table.alternateRowColor=#F5F5F5
Table.gridColor=#D6D6D6
Table.intercellSpacing=1,1 |
The problem is that the boolean renderer (see class Because that boolean renderer is implemented and set in |
fixed in latest |
I am adding table customization to my application using flatlaf. I want to achieve something like the following:
But after doing all property changes, I end up to the below extension:
Can you please help me to achieve required UI change.
The text was updated successfully, but these errors were encountered: