Highlights
- Styling individual components using string in CSS syntax (see PR #341 and #388)
- Typography (see PR #396)
- Unified backgrounds for window title bar is now enabled by default (Windows 10/11 only)
- Support Windows 11 snap layouts menu (see #397)
- TextField: support leading and trailing components and icons (see PR #386 and #378)
- Reworked core themes to make it easier to create new themes (see PR #390)
- Easier changing accent color (see PR #375)
- CheckBox and RadioButton improvements (see PR #414)
Incompatibilities
If you're using own FlatLaf properties files, then you may be affected by some incompatible changes.
See PR #390 and #414.
Change Log
New features and improvements
- Styling:
- Styling individual components using string in CSS syntax or
java.util.Map
. (PR #341)
E.g.:mySlider.putClientProperty( "FlatLaf.style", "trackWidth: 2" );
- Style classes allow defining style rules at a single place (in UI defaults)
and use them in any component. (PR #388)
E.g.:mySlider.putClientProperty( "FlatLaf.styleClass", "myclass" );
- Styling individual components using string in CSS syntax or
- Typography defines several font styles for headers and various text sizes,
which makes it easy to use consistent font styles across the application. (PR #396) - Native window decorations (Windows 10/11 only):
- Unified backgrounds for window title bar is now enabled by default (window
title bar has now same background color as window content). Bottom separator
for menu bars is no longer painted (if unified background is enabled). - Show Windows 11 snap layouts menu when hovering the mouse over the maximize
button. (issues #397 and #407) - Possibility to hide window title bar icon (for single window set client
propertyJRootPane.titleBarShowIcon
tofalse
; for all windows set UI
valueTitlePane.showIcon
tofalse
). - OptionPane: Hide window title bar icon by default. Can be be made visibly by
setting UI defaultOptionPane.showIcon
totrue
. (issue #416) - No longer show the Java "duke/cup" icon if no window icon image is set. (issue #416)
- Unified backgrounds for window title bar is now enabled by default (window
- TextField, FormattedTextField and PasswordField:
- Support leading and trailing icons (set client property
JTextField.leadingIcon
orJTextField.trailingIcon
to a
javax.swing.Icon
). (PR #378; issue #368) - Support leading and trailing components (set client property
JTextField.leadingComponent
orJTextField.trailingComponent
to a
java.awt.Component
). (PR #386) - Support "clear" (or "cancel") button to empty text field. Only shown if text
field is not empty, editable and enabled. (set client property
JTextField.showClearButton
totrue
). (PR #442)
- Support leading and trailing icons (set client property
- PasswordField: Support reveal (or "eye") button to show password. (see UI
valuePasswordField.showRevealButton
) (PR #442; issue #173) - TextComponents: Double/triple-click-and-drag now extends selection by whole words/lines.
- Theming improvements: Reworks core themes to make it easier to create new
themes (e.g. reduced explicit colors by using color functions). Note:
There are minor incompatible changes in FlatLaf properties files. (PR #390) - ToolBar:
- Toolbars are no longer floatable by default (dots on left side of toolbar
that allows dragging toolbar). UseUIManager.put( "ToolBar.floatable", true )
if you want the old behavior. - Skip components with empty input map (e.g.
JLabel
) when using arrow keys
to navigate in focusable buttons (if UI valueToolBar.focusableButtons
istrue
). - Support arrow-keys-only navigation within focusable buttons of toolbar (if
UI valueToolBar.focusableButtons
istrue
):- arrow keys move focus within toolbar
- tab-key moves focus out of toolbar
- if moving focus into the toolbar, focus recently focused toolbar button
- Toolbars are no longer floatable by default (dots on left side of toolbar
- ComboBox, Spinner, TextField and subclasses: Support specifying width of
border (see UI valueComponent.borderWidth
). - CheckBox and RadioButton:
- Made selected icon better recognizable in FlatLaf Light (use blue
border), Dark and Darcula (use lighter border) themes. IntelliJ
theme is not changed. - Support specifying width of icon border (see UI value
CheckBox.icon.borderWidth
). - Reworked icon UI defaults and added missing ones. Note: There are minor
incompatible changes in FlatLaf properties files.
- Made selected icon better recognizable in FlatLaf Light (use blue
- Slider: Support specifying width of thumb border (see UI value
Slider.thumbBorderWidth
). - TabbedPane: Optionally paint selected tab as card. (PR #343)
- MenuItem:
- Panel: Support painting background with rounded corners. (issue #367)
- Added more color functions to class
ColorFunctions
for easy use in
applications:lighten()
,darken()
,saturate()
,desaturate()
,spin()
,
tint()
,shade()
andluma()
. - Support defining fonts in FlatLaf properties files. (issue #384)
- Added method
FlatLaf.registerCustomDefaultsSource(URL packageUrl)
for JPMS. (issue #325) - Extras:
- SwingX:
- New "column control" icon for
JXTable
that scales and uses antialiasing. (issue #434)
- New "column control" icon for
Fixed bugs
- Native window decorations: Fixed
UnsatisfiedLinkError
on Windows 11 for ARM
processors. (issue #443) - MenuBar: Do not fill background if non-opaque and having custom background
color. (issue #409) - InternalFrame: Fill background to avoid that parent may shine through internal
frame if it contains non-opaque components. (better fix for issue #274) - SwingX: Fixed
NullPointerException
inFlatCaret
when using
org.jdesktop.swingx.prompt.PromptSupport.setPrompt()
on a text field and
then switching theme.
Changes since 2.0-rc1
- Added system property
flatlaf.nativeLibraryPath
to load native libraries
from a directory. (PR #453) - Fixed "endless recursion in font" exception in
FlatLaf$ActiveFont.createValue()
ifUIManager.getFont()
is invoked from
multiple threads. (issue #456) - PasswordField: Preserve reveal button state when switching theme. (PR #442; issue #173)
- PasswordField: Reveal button did not show password if
JPasswordField.setEchoChar()
was invoked from application. (PR #442; issue #173) - Slider: Fixed/improved focused indicator color when changing accent color. (PR #375)
- TextField:
- Extras: Fixed concurrent loading of SVG icons on multiple threads. (issue #459)
- Use FlatLaf native window decorations by default when running in JetBrains Runtime
(instead of using JetBrains custom decorations). System variable
flatlaf.useJetBrainsCustomDecorations
is nowfalse
by default (wastrue
in FlatLaf 1.x). (issue #454) - Native window decorations:
- Fixed blurry iconify/maximize/close button hover rectangles at 125%, 150% or 175% scaling. (issue #431)
- Updated maximize and restore icons for Windows 11 style. (requires Java 8u321, 11.0.14, 17.0.2 or 18+)
- Updated hover and pressed colors of iconify/maximize/close buttons for Windows 11 style.