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

FlatLaf not loading #121

Closed
wyskoj opened this issue Jul 16, 2022 · 2 comments
Closed

FlatLaf not loading #121

wyskoj opened this issue Jul 16, 2022 · 2 comments
Assignees
Labels
bug Something isn't working or is incorrect
Projects

Comments

@wyskoj
Copy link
Owner

wyskoj commented Jul 16, 2022

This is extremely bizarre...

Screenshot_2022-07-15-23-05-29-902_com miui gallery2

@wyskoj wyskoj added the bug Something isn't working or is incorrect label Jul 16, 2022
@wyskoj wyskoj self-assigned this Jul 16, 2022
@wyskoj wyskoj added this to To do in v1.7.0 Jul 16, 2022
@wyskoj wyskoj closed this as completed in a3abffe Jul 16, 2022
@DevCharly
Copy link

Can imaging one possibility where this could happen: FlatLaf 1.1.2 or older is somewhere on classpath.
Older FlatLaf versions do not have setup() methods. They use install() methods.

The class FlatDarkLaf is probably found because otherwise a ClassNotFoundException would be thrown.

You could use

FlatDarkLaf.install();

or

try {
    UIManager.setLookAndFeel( new FlatDarkLaf() );
} catch( Exception ex ) {
    System.err.println( "Failed to initialize LaF" );
}

to avoid this. (with the "risk" that a old FlatLaf version is used if my initial assumption is right)

BTW the "fix" in commit a3abffe probably does not work because NoSuchMethodError is not caught because it is not a subclass of Exception. Better catch java.lang.Throwable or java.lang.Error.

@wyskoj
Copy link
Owner Author

wyskoj commented Jul 17, 2022

Thank you, this makes sense, but what would cause an older version of FlatLaf to be on the classpath? I package this application with FlatLaf 2.1, so I'm not sure where it would come from...

Also thanks for catching that slip-up :)

@wyskoj wyskoj reopened this Jul 17, 2022
@wyskoj wyskoj closed this as completed in 0067940 Jul 19, 2022
@wyskoj wyskoj moved this from To do to Done in v1.7.0 Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect
Projects
No open projects
Development

No branches or pull requests

2 participants