Använd flatlaf ifall inget snyggt tema väljs

This commit is contained in:
Love 2022-12-04 16:23:37 +01:00
parent e06ff9478b
commit d934ba100a
No known key found for this signature in database
GPG Key ID: A3C10DC241C8FA9F

View File

@ -13,6 +13,8 @@ import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import com.formdev.flatlaf.FlatLightLaf;
/**
*
* @author Love Billenius & Simon Hansson
@ -24,6 +26,10 @@ public class Schack {
public Schack() throws IOException {
// Set theme
try {
if (UIManager.getSystemLookAndFeelClassName()
.equals("javax.swing.plaf.metal.MetalLookAndFeel"))
UIManager.setLookAndFeel(new FlatLightLaf());
else
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception cantGetSystemTheme) {
}