# StyleContext

Import: `import com.install4j.api.styles.StyleContext;`

```java
interface StyleContext
```

Context object that gives access to the style-relevant properties of a screen and its content component that should
be embedded into the screen style component. When a new screen is activated, the [`Style`](Style.md) instance receives a new
[`StyleContext`](StyleContext.md) instance with a call to [`StyleContextReceiver.setStyleContext`](StyleContextReceiver.md#setstylecontext-stylecontext). That method is called
before [`Style.createComponent`](Style.md#createcomponent).

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getContentComponent()`](#getcontentcomponent) | `JComponent` | Returns the UI component of the current [`Screen`](../screens/Screen.md) as returned by [`Screen.createComponent`](../screens/Screen.md#createcomponent). |
| [`getTitle()`](#gettitle) | `String` | The title of the screen as returned by [`Screen.getTitle`](../screens/Screen.md#gettitle). |
| [`getSubTitle()`](#getsubtitle) | `String` | The subtitle of the screen as returned by [`Screen.getSubTitle`](../screens/Screen.md#getsubtitle). |

### getContentComponent()

```java
JComponent getContentComponent()
```

Returns the UI component of the current [`Screen`](../screens/Screen.md) as returned by
[`Screen.createComponent`](../screens/Screen.md#createcomponent). It is the responsibility of the screen style to embed this component
when [`Style.createComponent`](Style.md#createcomponent) is called.


**Returns:** the UI component

### getTitle()

```java
String getTitle()
```

The title of the screen as returned by [`Screen.getTitle`](../screens/Screen.md#gettitle). It is the responsibility of the screen style to
display this title when [`Style.createComponent`](Style.md#createcomponent) is called.


**Returns:** the title

### getSubTitle()

```java
String getSubTitle()
```

The subtitle of the screen as returned by [`Screen.getSubTitle`](../screens/Screen.md#getsubtitle). It is the responsibility of the screen style to
display this subtitle when [`Style.createComponent`](Style.md#createcomponent) is called.


**Returns:** the title

