public class TitledPane extends Labeled
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"));
Type | Property and Description |
---|---|
BooleanProperty |
animated
The animated state of the TitledPane.
|
BooleanProperty |
collapsible
The collapsible state of the TitledPane.
|
<any> |
content
The content of the TitledPane.
|
BooleanProperty |
expanded
The expanded state of the TitledPane.
|
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, graphicProperty, graphicTextGapProperty, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, underlineProperty, wrapTextProperty
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
Modifier and Type | Class and Description |
---|---|
private static class |
TitledPane.StyleableProperties |
Modifier and Type | Field and Description |
---|---|
private BooleanProperty |
animated |
private BooleanProperty |
collapsible |
private <any> |
content
*
Properties *
*
|
private static java.lang.String |
DEFAULT_STYLE_CLASS
*
Stylesheet Handling *
*
|
private BooleanProperty |
expanded |
private static PseudoClass |
PSEUDO_CLASS_COLLAPSED |
private static PseudoClass |
PSEUDO_CLASS_EXPANDED |
Constructor and Description |
---|
TitledPane()
Creates a new TitledPane with no title or content.
|
TitledPane(java.lang.String title,
Node content)
Creates a new TitledPane with a title and content.
|
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
animatedProperty()
The animated state of the TitledPane.
|
BooleanProperty |
collapsibleProperty()
The collapsible state of the TitledPane.
|
<any> |
contentProperty()
The content of the TitledPane.
|
protected Skin<?> |
createDefaultSkin()
Create a new instance of the default skin for this control.
|
void |
executeAccessibleAction(AccessibleAction action,
java.lang.Object... parameters) |
BooleanProperty |
expandedProperty()
The expanded state of the TitledPane.
|
static java.util.List<<any>> |
getClassCssMetaData() |
Node |
getContent()
The content of the TitledPane.
|
Orientation |
getContentBias()
If wrapText is true, then contentBias will be HORIZONTAL, otherwise it is null.
|
java.util.List<<any>> |
getControlCssMetaData() |
boolean |
isAnimated()
Returns the animated state of the TitledPane.
|
boolean |
isCollapsible()
Returns the collapsible state of the TitlePane.
|
boolean |
isExpanded()
Gets the value of the property expanded.
|
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
void |
setAnimated(boolean value)
Specifies how the TitledPane should open and close.
|
void |
setCollapsible(boolean value)
Specifies if the TitledPane can be collapsed.
|
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.
|
void |
setExpanded(boolean value)
Sets the expanded state of the TitledPane.
|
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, getAlignment, getContentDisplay, getEllipsisString, getFont, getGraphic, getGraphicTextGap, getInitialAlignment, getLabelPadding, getLineSpacing, getText, getTextAlignment, getTextFill, getTextOverrun, graphicProperty, graphicTextGapProperty, isMnemonicParsing, isUnderline, isWrapText, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, setAlignment, setContentDisplay, setEllipsisString, setFont, setGraphic, setGraphicTextGap, setLineSpacing, setMnemonicParsing, setText, setTextAlignment, setTextFill, setTextOverrun, setUnderline, setWrapText, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, toString, underlineProperty, wrapTextProperty
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getControlChildren, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public final <any> contentProperty
public final BooleanProperty expandedProperty
isExpanded()
,
setExpanded(boolean)
public final BooleanProperty animatedProperty
isAnimated()
,
setAnimated(boolean)
public final BooleanProperty collapsibleProperty
isCollapsible()
,
setCollapsible(boolean)
private <any> content
private BooleanProperty expanded
private BooleanProperty animated
private BooleanProperty collapsible
private static final java.lang.String DEFAULT_STYLE_CLASS
private static final PseudoClass PSEUDO_CLASS_EXPANDED
private static final PseudoClass PSEUDO_CLASS_COLLAPSED
public TitledPane()
public TitledPane(java.lang.String title, Node content)
title
- The title of the TitledPane.content
- The content of the TitledPane.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.
value
- The content for this TitlePane.public final Node getContent()
Null
is returned when
if there is no content.public final <any> contentProperty()
public final void setExpanded(boolean value)
true
.value
- a flag indicating the expanded statepublic final boolean isExpanded()
public final BooleanProperty expandedProperty()
isExpanded()
,
setExpanded(boolean)
public final void setAnimated(boolean value)
true
. The default is true
.value
- a flag indicating the animated statepublic final boolean isAnimated()
public final BooleanProperty animatedProperty()
isAnimated()
,
setAnimated(boolean)
public final void setCollapsible(boolean value)
true
.value
- a flag indicating the collapsible statepublic final boolean isCollapsible()
public final BooleanProperty collapsibleProperty()
isCollapsible()
,
setCollapsible(boolean)
protected Skin<?> createDefaultSkin()
-fx-skin
or set explicitly in a sub-class with setSkin(...)
.createDefaultSkin
in class Control
public static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getControlCssMetaData()
getControlCssMetaData
in class Labeled
public Orientation getContentBias()
Labeled
getContentBias
in class Labeled
public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class Control
public void executeAccessibleAction(AccessibleAction action, java.lang.Object... parameters)
executeAccessibleAction
in class Control