Skip to content

Support for Custom Active / Inactive Tab Colors for NetBeans TabDisplayer in FlatLaf Integration #1046

@codesuman

Description

@codesuman

We are using FlatLaf (version 3.6) in a NetBeans Platform application (RELEASE111, NetBeans 11.1) and have encountered an issue with customizing the active and inactive tab colors for TabDisplayer components, which are part of the NetBeans windowing system. The default styling results in unselected tabs appearing as a harsh grey, which we aim to replace with more subtle, customizable colors (e.g., light grey for inactive, white for active).

Steps to Reproduce

  1. Set up a NetBeans Platform application using RELEASE111 (NetBeans 11.1).
  2. Integrate FlatLaf 3.6 via Maven dependency:
<dependency>
    <groupId>com.formdev</groupId>
    <artifactId>flatlaf</artifactId>
    <version>3.6</version>
</dependency>
  1. Attempt to register a custom UI delegate or set UIManager properties for TabDisplayer:
    UIManager.setLookAndFeel(new FlatLightLaf());
    UIManager.put("ProgressBarUI", "com.formdev.flatlaf.ui.FlatProgressBarUI");
    UIManager.put("JideTabbedPane.selectedTabBackground", Color.GREEN);

    UIManager.put("TabDisplayer.unselectedBackground", Color.RED); // Test color
    UIManager.put("TabDisplayer.selectedBackground", Color.GREEN); // Test color

Run the application and observe the TabDisplayer. Note that the custom colors (RED/GREEN) do not apply, and unselected tabs retain the default grey background.

Image Image

Expected Behavior

Active tabs (e.g., "SOne !!" / "One !!") should display a custom background color (e.g., white or green).
Inactive tabs (e.g., "Two !!") should display a custom background color (e.g., light grey or red).

Actual Behavior

The TabDisplayer retains its default grey background for inactive tabs, ignoring UIManager settings.
The custom UI delegate is not applied (verified via UI inspector showing the default delegate).
JIDE-based tabs (e.g., "Job View", "Task", "All") styled with JideTabbedPane.selectedTabBackground (set to GREEN) work correctly, indicating the issue is specific to TabDisplayer.

Component Hierarchy

  • In Code (TopComponent):

    • Tabs are implemented using TopComponent classes (e.g., for "SOne !!", "One !!", "Two !!"), which are managed by the NetBeans windowing system and rendered via TabDisplayer.

    • These are registered with the window system, triggering TabDisplayer rendering.

  • In UI Inspector (Screenshot Attached):

    • Hierarchy (from attached screenshot):
JFrame > JRootPane > JLayeredPane > MainWindow > JDesktopPane > MultiSplitPane > DefaultSplitContainer$ModePanel > TabbedAdapter > TabDisplayer.
* The TabDisplayer is the component rendering the tabs, with the UI delegate determining the visual style.

Environment

  • FlatLaf Version: 3.6
  • NetBeans Platform: RELEASE111 (NetBeans 11.1)
  • Java Version: 21
  • OS: Windows 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions