Interface FlatStyleableComponent
- All Known Implementing Classes:
FlatButton
,FlatCheckBox
,FlatCheckBoxMenuItem
,FlatComboBox
,FlatEditorPane
,FlatFormattedTextField
,FlatInternalFrame
,FlatLabel
,FlatList
,FlatMenu
,FlatMenuBar
,FlatMenuItem
,FlatPasswordField
,FlatPopupMenu
,FlatPopupMenuSeparator
,FlatProgressBar
,FlatRadioButton
,FlatRadioButtonMenuItem
,FlatScrollBar
,FlatScrollPane
,FlatSeparator
,FlatSlider
,FlatSpinner
,FlatSplitPane
,FlatTabbedPane
,FlatTable
,FlatTableHeader
,FlatTextArea
,FlatTextField
,FlatTextPane
,FlatToggleButton
,FlatToolBar
,FlatToolBarSeparator
,FlatTree
public interface FlatStyleableComponent
Interface for all styleable FlatLaf components.
If you already have custom subclasses of Swing components, you can add this interface to your components to add styling getter and setter methods to them.
- Since:
- 2
-
Method Summary
Modifier and TypeMethodDescriptiongetClientProperty
(Object key) OverridesJComponent.getClientProperty(Object)
.default String
getStyle()
Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") ornull
if no style has been assigned.default String
Returns the style class(es) of a component (separated by space characters) ornull
if no style class has been assigned.Returns the style of a component asMap
<String, Object> ornull
if no style has been assigned.void
putClientProperty
(Object key, Object value) OverridesJComponent.putClientProperty(Object, Object)
.default void
Specifies the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...").default void
setStyleClass
(String styleClass) Specifies the style class(es) of a component (separated by space characters).default void
setStyleMap
(Map<String, Object> styleMap) Specifies the style of a component asMap
<String, Object> with binary values.
-
Method Details
-
getStyle
Returns the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...") ornull
if no style has been assigned.- See Also:
-
setStyle
Specifies the style of a component as String in CSS syntax ("key1: value1; key2: value2; ...").The keys are the same as used in UI defaults, but without component type prefix. E.g. for UI default
Slider.thumbSize
use keythumbSize
.The syntax of the CSS values is the same as used in FlatLaf properties files (https://www.formdev.com/flatlaf/properties-files/), but some features are not supported (e.g. variables).
- See Also:
-
getStyleMap
Returns the style of a component asMap
<String, Object> ornull
if no style has been assigned.- See Also:
-
setStyleMap
Specifies the style of a component asMap
<String, Object> with binary values.The keys are the same as used in UI defaults, but without component type prefix. E.g. for UI default
Slider.thumbSize
use keythumbSize
.The values are not parsed from a string. They must be binary.
- See Also:
-
getStyleClass
Returns the style class(es) of a component (separated by space characters) ornull
if no style class has been assigned.- See Also:
-
setStyleClass
Specifies the style class(es) of a component (separated by space characters).- See Also:
-
getClientProperty
OverridesJComponent.getClientProperty(Object)
. -
putClientProperty
OverridesJComponent.putClientProperty(Object, Object)
.
-