mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 06:57:13 -06:00
fix: #60 Illegal reflective access operation on mac
This commit is contained in:
@@ -190,11 +190,14 @@ public abstract class FlatLaf
|
|||||||
*/
|
*/
|
||||||
private BasicLookAndFeel getBase() {
|
private BasicLookAndFeel getBase() {
|
||||||
if( base == null ) {
|
if( base == null ) {
|
||||||
if( SystemInfo.IS_MAC ) {
|
if( SystemInfo.IS_MAC) {
|
||||||
// use Mac Aqua LaF as base
|
|
||||||
String aquaLafClassName = "com.apple.laf.AquaLookAndFeel";
|
String aquaLafClassName = "com.apple.laf.AquaLookAndFeel";
|
||||||
try {
|
try {
|
||||||
base = (BasicLookAndFeel) Class.forName( aquaLafClassName ).getDeclaredConstructor().newInstance();
|
if (SystemInfo.IS_JAVA_9_OR_LATER) {
|
||||||
|
base = (BasicLookAndFeel) UIManager.createLookAndFeel("Mac OS X");
|
||||||
|
} else {
|
||||||
|
base = (BasicLookAndFeel) Class.forName( aquaLafClassName ).getDeclaredConstructor().newInstance();
|
||||||
|
}
|
||||||
} catch( Exception ex ) {
|
} catch( Exception ex ) {
|
||||||
LOG.log( Level.SEVERE, "FlatLaf: Failed to initialize base look and feel '" + aquaLafClassName + "'.", ex );
|
LOG.log( Level.SEVERE, "FlatLaf: Failed to initialize base look and feel '" + aquaLafClassName + "'.", ex );
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
|
|||||||
Reference in New Issue
Block a user