Skip to content
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

showGrid Display Issue in Table when toggle the theme #733

Closed
CRY-D opened this issue Sep 7, 2023 · 3 comments
Closed

showGrid Display Issue in Table when toggle the theme #733

CRY-D opened this issue Sep 7, 2023 · 3 comments
Milestone

Comments

@CRY-D
Copy link

CRY-D commented Sep 7, 2023

I'm encountering an issue with the showGrid feature in a JTable . Specifically, the problem arises when switching between the dark and light themes.
Initially, the grid lines in the JTable are displayed correctly.
And when I Switch the theme to light, then Switch it back to the dark, I Observe that the grid lines in the JTable not displayed properly or exhibit unexpected behavior.

The Initial state:
Screenshot from 2023-09-07 21-15-35

when i switch to light:
Screenshot from 2023-09-07 21-16-04

when switch it back to dark
Screenshot from 2023-09-07 21-16-14

i've tried booth methods: flatTable.setShowGrid(true);
and the FlatLaf.properties

#@accentColor=#FF3B30
defaultFont=15 RB
h1.font=bold +12
Component.focusWidth=1
Component.borderWidth=1
#Button.acr=10
#TextComponent.arc=10
#Panel.border=com.formdev.flatlaf.ui.FlatBorder
#TableHeader.background=darken(@background,5%)
List.selectionInsets=0,1,0,1
List.selectionArc= 6
ActionPanel.border=com.formdev.flatlaf.ui.FlatBorder
Table.showGrid=true
Table.alternateRowColor=darken(@background,1%)
Table.intercellSpacing=1,1
ScrollBar.showButtons=true
@DevCharly
Copy link
Collaborator

Table.showGrid is not used in FlatLaf properties files.

Use:

Table.showHorizontalLines = true
Table.showVerticalLines = true

But it could be a bug that invoking table.setShowGrid( true ) is lost when switching L&F.
I'll have a look...

If you need a quick solution to have permanent grid lines for a single table:

JTable table = new JTable() {
    @Override
    public void updateUI() {
        super.updateUI();
        setShowGrid( true );
    }
};

@CRY-D
Copy link
Author

CRY-D commented Sep 29, 2023

A good solution for me, thank you

@DevCharly
Copy link
Collaborator

fixed in latest 3.3-SNAPSHOT: https://github.com/JFormDesigner/FlatLaf#snapshots

@DevCharly DevCharly added this to the 3.3 milestone Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants