mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 04:40:11 +01:00
Använd flatlaf ifall inget snyggt tema väljs
This commit is contained in:
parent
e06ff9478b
commit
d934ba100a
@ -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,7 +26,11 @@ public class Schack {
|
||||
public Schack() throws IOException {
|
||||
// Set theme
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
if (UIManager.getSystemLookAndFeelClassName()
|
||||
.equals("javax.swing.plaf.metal.MetalLookAndFeel"))
|
||||
UIManager.setLookAndFeel(new FlatLightLaf());
|
||||
else
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (Exception cantGetSystemTheme) {
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user