github JFormDesigner/FlatLaf 2.0

latest releases: 3.5.2, 3.5.1, 3.5...
2 years ago

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)

grafik

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" );
  • 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
      property JRootPane.titleBarShowIcon to false; for all windows set UI
      value TitlePane.showIcon to false).
    • OptionPane: Hide window title bar icon by default. Can be be made visibly by
      setting UI default OptionPane.showIcon to true. (issue #416)
    • No longer show the Java "duke/cup" icon if no window icon image is set. (issue #416)
  • TextField, FormattedTextField and PasswordField:
    • Support leading and trailing icons (set client property
      JTextField.leadingIcon or JTextField.trailingIcon to a
      javax.swing.Icon). (PR #378; issue #368)
    • Support leading and trailing components (set client property
      JTextField.leadingComponent or JTextField.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 to true). (PR #442)
  • PasswordField: Support reveal (or "eye") button to show password. (see UI
    value PasswordField.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). Use UIManager.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 value ToolBar.focusableButtons is true).
    • Support arrow-keys-only navigation within focusable buttons of toolbar (if
      UI value ToolBar.focusableButtons is true):
      • arrow keys move focus within toolbar
      • tab-key moves focus out of toolbar
      • if moving focus into the toolbar, focus recently focused toolbar button
  • ComboBox, Spinner, TextField and subclasses: Support specifying width of
    border (see UI value Component.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.
  • Slider: Support specifying width of thumb border (see UI value Slider.thumbBorderWidth).
  • TabbedPane: Optionally paint selected tab as card. (PR #343)
  • MenuItem:
    • Paint the selected icon when the item is selected. (PR #415)
    • Vertically align text if icons have different widths. (issue #437)
  • 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() and luma().
  • Support defining fonts in FlatLaf properties files. (issue #384)
  • Added method FlatLaf.registerCustomDefaultsSource(URL packageUrl) for JPMS. (issue #325)
  • Extras:
    • Added class FlatDesktop for easy integration into macOS screen menu
      (About, Preferences and Quit) when using Java 8.
    • FlatSVGIcon: Support loading SVG from URL (for JPMS), URI, File or
      InputStream. (issues #419 and #325)
    • FlatSVGUtils: Support loading SVG from URL (for JPMS). (issue #325)
  • SwingX:
    • New "column control" icon for JXTable that scales and uses antialiasing. (issue #434)

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 in FlatCaret 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() if UIManager.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:
    • Improved hover/pressed/selected colors of leading/trailing buttons (e.g.
      "reveal" button in password field). (issue #452)
    • Clear button no longer paints over round border. (issue #451)
  • 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 now false by default (was true
    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.

Don't miss a new FlatLaf release

NewReleases is sending notifications on new releases.