Top Description Inners Fields Constructors Methods
javafx.scene.control

public Class TitledPane

extends Labeled
Class Inheritance
Annotations
@DefaultProperty:content
Imports
java.util.ArrayList, .Collections, .List, javafx.beans.property.BooleanProperty, .BooleanPropertyBase, .ObjectProperty, .SimpleObjectProperty, javafx.geometry.Orientation, javafx.scene.AccessibleAction, .AccessibleAttribute, .AccessibleRole, .Node, javafx.css.PseudoClass, .StyleableBooleanProperty, .CssMetaData, .Styleable, .StyleableProperty, javafx.css.converter.BooleanConverter, javafx.scene.control.skin.TitledPaneSkin, javafx.beans.DefaultProperty

A TitledPane is a panel with a title that can be opened and closed.

The panel in a TitledPane can be any Node such as UI controls or groups of nodes added to a layout container.

It is not recommended to set the MinHeight, PrefHeight, or MaxHeight for this control. Unexpected behavior will occur because the TitledPane's height changes when it is opened or closed.

Note that whilst TitledPane extends from Labeled, the inherited properties are used to manipulate the TitledPane header, not the content area itself. If the intent is to modify the content area, consider using a layout container such as javafx.scene.layout.StackPane and setting your actual content inside of that. You can then manipulate the StackPane to get the layout results you are after.

Example:

 TitledPane t1 = new TitledPane("T1", new Button("B1"));
Image of the TitledPane control
Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private BooleanProperty
private BooleanProperty
private ObjectProperty<Node>
private static final String
private BooleanProperty
private static final PseudoClass
private static final PseudoClass

Constructor Summary

AccessConstructor and Description
public
TitledPane()

Creates a new TitledPane with no title or content.

public
TitledPane(String
The title of the TitledPane.
title
,
Node
The content of the TitledPane.
content
)

Creates a new TitledPane with a title and content.

Method Summary

Modifier and TypeMethod and Description
public final BooleanProperty

Returns:

the animated state property
animatedProperty
()

The animated state of the TitledPane.

public final BooleanProperty

Returns:

the collapsible property
collapsibleProperty
()

The collapsible state of the TitledPane.

public final ObjectProperty<Node>

Returns:

The content of the TitlePane.
contentProperty
()

The content of the TitledPane.

protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public void
executeAccessibleAction(AccessibleAction
the action to execute
action
,
Object...
optional list of parameters
parameters
)

Overrides javafx.scene.control.Control.executeAccessibleAction.

This method is called by the assistive technology to request the action indicated by the argument should be executed.

public final BooleanProperty

Returns:

the expanded state property
expandedProperty
()

The expanded state of the TitledPane.

public static List<CssMetaData<? extends Styleable, ?>>

Returns:

the CssMetaData
getClassCssMetaData
()

Hides javafx.scene.control.Labeled.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public final Node

Returns:

The content of this TitledPane.
getContent
()

The content of the TitledPane.

public Orientation
getContentBias()

Overrides javafx.scene.control.Labeled.getContentBias.

If wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.

public List<CssMetaData<? extends Styleable, ?>>
getControlCssMetaData()

Overrides javafx.scene.control.Labeled.getControlCssMetaData.

Gets the unmodifiable list of the control's CSS-styleable properties.

public final boolean

Returns:

The animated state of the TitledPane.
isAnimated
()

Returns the animated state of the TitledPane.

public final boolean

Returns:

The collapsible state of the TitledPane.
isCollapsible
()

Returns the collapsible state of the TitlePane.

public final boolean
public Object
queryAccessibleAttribute(AccessibleAttribute
the requested attribute
attribute
,
Object...
optional list of parameters
parameters
)

Overrides javafx.scene.control.Control.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

public final void
setAnimated(boolean
a flag indicating the animated state
value
)

Specifies how the TitledPane should open and close.

public final void
setCollapsible(boolean
a flag indicating the collapsible state
value
)

Specifies if the TitledPane can be collapsed.

public final void
setContent(Node
The content for this TitlePane.
value
)

The content of the TitlePane which can be any Node such as UI controls or groups of nodes added to a layout container.

public final void
setExpanded(boolean
a flag indicating the expanded state
value
)

Sets the expanded state of the TitledPane.

Inherited from javafx.scene.control.Labeled:
alignmentPropertycontentDisplayPropertyellipsisStringPropertyfontPropertygetAlignmentgetContentDisplaygetEllipsisStringgetFontgetGraphicgetGraphicTextGapgetInitialAlignmentgetLabelPaddinggetLineSpacinggetTextgetTextAlignmentgetTextFillgetTextOverrungraphicPropertygraphicTextGapPropertyisMnemonicParsingisTextTruncatedisUnderlineisWrapTextlabelPaddingPropertylineSpacingPropertymnemonicParsingPropertysetAlignmentsetContentDisplaysetEllipsisStringsetFontsetGraphicsetGraphicTextGapsetLineSpacingsetMnemonicParsingsetTextsetTextAlignmentsetTextFillsetTextOverrunsetUnderlinesetWrapTexttextAlignmentPropertytextFillPropertytextOverrunPropertytextPropertytextTruncatedPropertytoStringunderlinePropertywrapTextProperty

Field Detail

animatedback to summary
private BooleanProperty animated
collapsibleback to summary
private BooleanProperty collapsible
contentback to summary
private ObjectProperty<Node> content
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
expandedback to summary
private BooleanProperty expanded
PSEUDO_CLASS_COLLAPSEDback to summary
private static final PseudoClass PSEUDO_CLASS_COLLAPSED
PSEUDO_CLASS_EXPANDEDback to summary
private static final PseudoClass PSEUDO_CLASS_EXPANDED

Constructor Detail

TitledPaneback to summary
public TitledPane()

Creates a new TitledPane with no title or content.

TitledPaneback to summary
public TitledPane(String title, Node content)

Creates a new TitledPane with a title and content.

Parameters
title:String

The title of the TitledPane.

content:Node

The content of the TitledPane.

Method Detail

animatedPropertyback to summary
public final BooleanProperty animatedProperty()

The animated state of the TitledPane.

Returns:BooleanProperty

the animated state property

collapsiblePropertyback to summary
public final BooleanProperty collapsibleProperty()

The collapsible state of the TitledPane.

Returns:BooleanProperty

the collapsible property

contentPropertyback to summary
public final ObjectProperty<Node> contentProperty()

The content of the TitledPane.

Returns:ObjectProperty<Node>

The content of the TitlePane.

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Returns:Skin<?>

new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.

Annotations
@Override
executeAccessibleActionback to summary
public void executeAccessibleAction(AccessibleAction action, Object... parameters)

Overrides javafx.scene.control.Control.executeAccessibleAction.

Doc from javafx.scene.control.Control.executeAccessibleAction.

This method is called by the assistive technology to request the action indicated by the argument should be executed.

This method is commonly overridden by subclasses to implement action that are required for a specific role.
If a particular action is not handled, the superclass implementation must be called.

Parameters
action:AccessibleAction

Doc from javafx.scene.Node.executeAccessibleAction.

the action to execute

parameters:Object[]

Doc from javafx.scene.Node.executeAccessibleAction.

optional list of parameters

Annotations
@Override
expandedPropertyback to summary
public final BooleanProperty expandedProperty()

The expanded state of the TitledPane.

Returns:BooleanProperty

the expanded state property

getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.control.Labeled.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

Returns:List<CssMetaData<? extends Styleable, ?>>

the CssMetaData

Since
JavaFX 8.0
getContentback to summary
public final Node getContent()

The content of the TitledPane. Null is returned when if there is no content.

Returns:Node

The content of this TitledPane.

getContentBiasback to summary
public Orientation getContentBias()

Overrides javafx.scene.control.Labeled.getContentBias.

Doc from javafx.scene.control.Labeled.getContentBias.

If wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.

Returns:Orientation

orientation of width/height dependency or null if there is none

Annotations
@Override
getControlCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getControlCssMetaData()

Overrides javafx.scene.control.Labeled.getControlCssMetaData.

Doc from javafx.scene.control.Labeled.getControlCssMetaData.

Gets the unmodifiable list of the control's CSS-styleable properties.

Returns:List<CssMetaData<? extends Styleable, ?>>

Doc from javafx.scene.control.Control.getControlCssMetaData.

the unmodifiable list of the control's CSS-styleable properties

Annotations
@Override
Since
JavaFX 8.0
isAnimatedback to summary
public final boolean isAnimated()

Returns the animated state of the TitledPane.

Returns:boolean

The animated state of the TitledPane.

isCollapsibleback to summary
public final boolean isCollapsible()

Returns the collapsible state of the TitlePane.

Returns:boolean

The collapsible state of the TitledPane.

isExpandedback to summary
public final boolean isExpanded()
queryAccessibleAttributeback to summary
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.Control.queryAccessibleAttribute.

Doc from javafx.scene.control.Control.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
If a particular attribute is not handled, the superclass implementation must be called.

Parameters
attribute:AccessibleAttribute

Doc from javafx.scene.Node.queryAccessibleAttribute.

the requested attribute

parameters:Object[]

Doc from javafx.scene.Node.queryAccessibleAttribute.

optional list of parameters

Returns:Object

Doc from javafx.scene.Node.queryAccessibleAttribute.

the value for the requested attribute

Annotations
@Override
setAnimatedback to summary
public final void setAnimated(boolean value)

Specifies how the TitledPane should open and close. The panel will be animated out when this value is set to true. The default is true.

Parameters
value:boolean

a flag indicating the animated state

setCollapsibleback to summary
public final void setCollapsible(boolean value)

Specifies if the TitledPane can be collapsed. The default is true.

Parameters
value:boolean

a flag indicating the collapsible state

setContentback to summary
public final void setContent(Node value)

The content of the TitlePane which can be any Node such as UI controls or groups of nodes added to a layout container.

Parameters
value:Node

The content for this TitlePane.

setExpandedback to summary
public final void setExpanded(boolean value)

Sets the expanded state of the TitledPane. The default is true.

Parameters
value:boolean

a flag indicating the expanded state

javafx.scene.control back to summary

private Class TitledPane.StyleableProperties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<TitledPane, Boolean>
private static final CssMetaData<TitledPane, Boolean>
private static final List<CssMetaData<? extends Styleable, ?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ANIMATEDback to summary
private static final CssMetaData<TitledPane, Boolean> ANIMATED
COLLAPSIBLEback to summary
private static final CssMetaData<TitledPane, Boolean> COLLAPSIBLE
STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()