Interface FlatSystemProperties
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSpecifies whether animations are enabled.static final StringSpecifies whether the menu bar is embedded into the window title pane if window decorations are enabled.static final StringSpecifies a directory in which the FlatLaf native libraries are searched for.static final StringSpecifies a custom scale factor used to scale the UI.static final StringSpecifies whether values smaller than 100% are allowed for the user scale factor (seeUIScale.getUserScaleFactor()).static final StringSpecifies whether user scaling mode is enabled.static final StringSpecifies whether FlatLaf updates the UI when the system font changes.static final StringDeprecated.No longer used since FlatLaf 3.3.static final StringSpecifies whether FlatLaf native library should be used.static final StringSpecifies whether native rounded popup borders should be used (if supported by operating system).static final StringSpecifies whether safe triangle is used to improve usability of submenus.static final StringSpecifies whether vertical text position is corrected when UI is scaled on HiDPI screens.static final StringSpecifies whether Ubuntu font should be used on Ubuntu Linux.static final StringSpecifies whether native window decorations should be used when creatingJFrameorJDialog. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic booleangetBoolean(String key, boolean defaultValue) Checks whether a system property is set and returnstrueif its value is"true"(case-insensitive), otherwise it returnsfalse.static BooleangetBooleanStrict(String key, Boolean defaultValue) Checks whether a system property is set and returnsBoolean.TRUEif its value is"true"(case-insensitive) or returnsBoolean.FALSEif its value is"false"(case-insensitive).
-
Field Details
-
UI_SCALE
Specifies a custom scale factor used to scale the UI.If Java runtime scales (Java 9 or later), this scale factor is applied on top of the Java system scale factor. Java 8 does not scale and this scale factor replaces the user scale factor that FlatLaf computes based on the font. To replace the Java 9+ system scale factor, use system property "sun.java2d.uiScale", which has the same syntax as this one.
Since FlatLaf 1.1.2: Scale factors less than 100% are allowed.
Allowed Values e.g.
1.5,1.5x,150%or144dpi(96dpi is 100%)- See Also:
-
UI_SCALE_ENABLED
Specifies whether user scaling mode is enabled.Allowed Values
falseandtrue
Defaulttrue- See Also:
-
UI_SCALE_ALLOW_SCALE_DOWN
Specifies whether values smaller than 100% are allowed for the user scale factor (seeUIScale.getUserScaleFactor()).Allowed Values
falseandtrue
Defaultfalse- Since:
- 1.1.2
- See Also:
-
USE_UBUNTU_FONT
Specifies whether Ubuntu font should be used on Ubuntu Linux. By default, if not running in a JetBrains Runtime, the Liberation Sans font is used because there are rendering issues (in Java) with Ubuntu fonts.Allowed Values
falseandtrue
Defaultfalse- See Also:
-
USE_WINDOW_DECORATIONS
Specifies whether native window decorations should be used when creatingJFrameorJDialog.Setting this to
trueforces using native window decorations even if they are not enabled by the application.
Setting this tofalsedisables using native window decorations.This system property has higher priority than client property
FlatClientProperties.USE_WINDOW_DECORATIONSand UI defaultTitlePane.useWindowDecorations.(requires Windows 10/11)
Allowed Values
falseandtrue
Default none- See Also:
-
USE_JETBRAINS_CUSTOM_DECORATIONS
Deprecated.No longer used since FlatLaf 3.3. Retained for API compatibility.Specifies whether JetBrains Runtime custom window decorations should be used when creatingJFrameorJDialog. Requires that the application runs in a JetBrains Runtime (based on OpenJDK).Setting this to
falsedisables using JetBrains Runtime custom window decorations. Then FlatLaf native window decorations are used.(requires Windows 10/11)
Allowed Values
falseandtrue
Defaultfalse(since v2; wastruein v1)- See Also:
-
MENUBAR_EMBEDDED
Specifies whether the menu bar is embedded into the window title pane if window decorations are enabled.Setting this to
trueforces embedding.
Setting this tofalsedisables embedding.This system property has higher priority than client property
FlatClientProperties.MENU_BAR_EMBEDDEDand UI defaultTitlePane.menuBarEmbedded.(requires Windows 10/11)
Allowed Values
falseandtrue
Default none- See Also:
-
ANIMATION
Specifies whether animations are enabled.Allowed Values
falseandtrue
Defaulttrue- See Also:
-
USE_ROUNDED_POPUP_BORDER
Specifies whether native rounded popup borders should be used (if supported by operating system).(requires Windows 11 or macOS)
Allowed Values
falseandtrue
Defaulttrue; except in FlatLaf 3.5.x on macOS 14.4+ where it wasfalse- Since:
- 3.5.2
- See Also:
-
USE_TEXT_Y_CORRECTION
Specifies whether vertical text position is corrected when UI is scaled on HiDPI screens.Allowed Values
falseandtrue
Defaulttrue- See Also:
-
UPDATE_UI_ON_SYSTEM_FONT_CHANGE
Specifies whether FlatLaf updates the UI when the system font changes. Iftrue,SwingUtilities.updateComponentTreeUI(java.awt.Component)gets invoked for all windows if the system font has changed. This is the similar to when switching to another look and feel (theme). Applications that do not work correctly when switching look and feel, should disable this option to avoid corrupted UI.Allowed Values
falseandtrue
Defaulttrue- Since:
- 2.5
- See Also:
-
USE_NATIVE_LIBRARY
Specifies whether FlatLaf native library should be used.Setting this to
falsedisables loading native library, which also disables some features that depend on the native library.Allowed Values
falseandtrue
Defaulttrue- Since:
- 3.2
- See Also:
-
NATIVE_LIBRARY_PATH
Specifies a directory in which the FlatLaf native libraries are searched for. The path can be absolute or relative to current application working directory. This can be used to avoid extraction of the native libraries to the temporary directory at runtime.If the value is
"system"(supported since FlatLaf 2.6), thenSystem.loadLibrary(String)RESTRICTED is used to load the native library. This searches for the native library in classloader of caller (usingClassLoader.findLibrary(String)) and in paths specified in system propertiessun.boot.library.pathandjava.library.path.If the native library can not be loaded from the given path (or via
System.loadLibrary(String)RESTRICTED), then the embedded native library is extracted to the temporary directory and loaded from there.The file names of the native libraries must be either:
- the same as in flatlaf.jar in package 'com/formdev/flatlaf/natives' (required for "system") or
- when downloaded from Maven central then as described here: https://www.formdev.com/flatlaf/native-libraries/ (requires FlatLaf 3.4)
Note: Since FlatLaf 3.1 it is recommended to download the FlatLaf native libraries from Maven central and distribute them with your application in the same directory as flatlaf.jar. Then it is not necessary to set this system property. See https://www.formdev.com/flatlaf/native-libraries/ for details.
- Since:
- 2
- See Also:
-
USE_SUB_MENU_SAFE_TRIANGLE
Specifies whether safe triangle is used to improve usability of submenus.Allowed Values
falseandtrue
Defaulttrue- Since:
- 3.5.1
- See Also:
-
-
Method Details
-
getBoolean
Checks whether a system property is set and returnstrueif its value is"true"(case-insensitive), otherwise it returnsfalse. If the system property is not set,defaultValueis returned. -
getBooleanStrict
-