FlatLaf.isLafDark() added

This commit is contained in:
Karl Tauber
2020-06-06 22:00:54 +02:00
parent 1381a34752
commit 732ca8be56
4 changed files with 11 additions and 11 deletions

View File

@@ -113,6 +113,14 @@ public abstract class FlatLaf
public abstract boolean isDark();
/**
* Checks whether the current look and feel is dark.
*/
public static boolean isLafDark() {
LookAndFeel lookAndFeel = UIManager.getLookAndFeel();
return lookAndFeel instanceof FlatLaf && ((FlatLaf)lookAndFeel).isDark();
}
/**
* Returns whether FlatLaf supports custom window decorations.
* This depends on the operating system and on the used Java runtime.