Interface Skin<C extends Skinnable>
- Type Parameters:
-
C- A subtype of Skinnable that the Skin represents. This allows for Skin implementation to access theSkinnableimplementation, which is usually aControlimplementation.
- All Known Implementing Classes:
-
AccordionSkin,ButtonBarSkin,ButtonSkin,CellSkinBase,CheckBoxSkin,ChoiceBoxSkin,ColorPickerSkin,ComboBoxBaseSkin,ComboBoxListViewSkin,ComboBoxPopupControl,ContextMenuSkin,DateCellSkin,DatePickerSkin,HTMLEditorSkin,HyperlinkSkin,LabeledSkinBase,LabelSkin,ListCellSkin,ListViewSkin,MenuBarSkin,MenuButtonSkin,MenuButtonSkinBase,PaginationSkin,ProgressBarSkin,ProgressIndicatorSkin,RadioButtonSkin,ScrollBarSkin,ScrollPaneSkin,SeparatorSkin,SkinBase,SliderSkin,SpinnerSkin,SplitMenuButtonSkin,SplitPaneSkin,TableCellSkin,TableCellSkinBase,TableRowSkin,TableRowSkinBase,TableViewSkin,TableViewSkinBase,TabPaneSkin,TextAreaSkin,TextFieldSkin,TextInputControlSkin,TitledPaneSkin,ToggleButtonSkin,ToolBarSkin,TooltipSkin,TreeCellSkin,TreeTableCellSkin,TreeTableRowSkin,TreeTableViewSkin,TreeViewSkin,VirtualContainerBase
public interface Skin<C extends Skinnable>
A Skin implementation should generally avoid modifying its control outside of install() method. The life cycle of a Skin implementation is as follows:
- Since:
- JavaFX 2.0
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
void |
dispose() |
Called when a previously installed skin is about to be removed from its associated control. |
Node |
getNode() |
Gets the Node which represents this Skin. |
C |
getSkinnable() |
Gets the Skinnable to which this Skin is assigned. |
default void |
install() |
Called once when Skin is set. |
Method Details
getSkinnable
C getSkinnable()
dispose(). The caller who constructs a Skinnable must also construct a Skin and properly establish the relationship between the Control and its Skin.
- Returns:
- A non-null Skinnable, or null value if disposed.
getNode
Node getNode()
dispose(), and must never change except when changing to null.- Returns:
- A non-null Node, except when the Skin has been disposed.
install
default void install()
Skin is set. This method is called after the previous skin, if any, has been uninstalled via its dispose() method. The skin can now safely make changes to its associated control, like registering listeners, adding child nodes, and modifying properties and event handlers. Application code must not call this method.
The default implementation of this method does nothing.
- Implementation Note:
- Skins only need to implement
installif they need to make direct changes to the control like overwriting properties or event handlers. Such skins should ensure these changes are undone in theirdispose()method. - Since:
- 20
dispose
void dispose()
getSkinnable() and getNode() should return null. Calling dispose() more than once has no effect.
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.