mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-07 14:30:56 +03:00
fix #60 Illegal reflective access operation on mac
This commit is contained in:
@@ -191,8 +191,15 @@ public abstract class FlatLaf
|
|||||||
private BasicLookAndFeel getBase() {
|
private BasicLookAndFeel getBase() {
|
||||||
if( base == null ) {
|
if( base == null ) {
|
||||||
if( SystemInfo.IS_MAC ) {
|
if( SystemInfo.IS_MAC ) {
|
||||||
base = (BasicLookAndFeel) UIManager.getLookAndFeel();
|
// use Mac Aqua LaF as base
|
||||||
} else {
|
String aquaLafClassName = "com.apple.laf.AquaLookAndFeel";
|
||||||
|
try {
|
||||||
|
base = (BasicLookAndFeel) Class.forName( aquaLafClassName ).getDeclaredConstructors()[0].newInstance();
|
||||||
|
} catch( Exception ex ) {
|
||||||
|
LOG.log( Level.SEVERE, "FlatLaf: Failed to initialize base look and feel '" + aquaLafClassName + "'.", ex );
|
||||||
|
throw new IllegalStateException();
|
||||||
|
}
|
||||||
|
} else
|
||||||
base = new MetalLookAndFeel();
|
base = new MetalLookAndFeel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user