# LookAndFeelHandler

Import: `import com.install4j.api.laf.LookAndFeelHandler;`

```java
interface LookAndFeelHandler extends LookAndFeelEnhancer
```

A look and feel handler can apply a look and feel.
An implementation of this interface together with its dependencies
can be added on the "Installer->Custom Code & Resources" step and can then be
configured on the "Installer->Look & Feel" step.

The super-interface [`LookAndFeelEnhancer`](LookAndFeelEnhancer.md) contains a number of methods with
default implementations that can be overridden in order to customize certain aspects
of creating the UI.

## Inherited from

- [LookAndFeelEnhancer](LookAndFeelEnhancer.md) — 12 methods, 1 fields

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`applyLookAndFeel(boolean)`](#applylookandfeel-boolean) | `void` | Called when the installer application is ready to apply the look and feel. |
| [`setDark(boolean)`](#setdark-boolean) | `void` | Switch between dark and light mode. |

### applyLookAndFeel(boolean)

```java
void applyLookAndFeel(boolean darkDesktop) throws Exception
```

Called when the installer application is ready to apply the look and feel.


**Parameters:**

- `darkDesktop` — if the desktop is detected to be in dark mode. This auto-detection
is implemented for Windows 10 and macOS.

### setDark(boolean)

```java
default void setDark(boolean dark)
```

Switch between dark and light mode.
This method will be called when user code invokes [`UiUtil.setDarkUi`](../UiUtil.md#setdarkui-boolean),
that method will also update the component hierarchy in all windows.

By default, this method throws an `UnsupportedOperationException`.
If it is implemented, [`LookAndFeelHandler.isDarkModeSwitchingSupported`](LookAndFeelHandler.md#isdarkmodeswitchingsupported) must be
overridden to return `true`.


**Parameters:**

- `dark` — `true` for dark mode

**See also:**

- [UiUtil.setDarkUi](../UiUtil.md#setdarkui-boolean)

