Client properties |
|
|
|
|
Specifies the speed of the animation effects on a particular component.
The value should one of the org.jvnet.lafwidget.utils.AnimationKind
enum values and can be set on a component, one of its ancestors or globally on UIManager table.
The default value is AnimationKind.REGULAR.
Example of creating four buttons with different animation speed:
JButton bNoAnimation = new JButton("No animation");
|
|
|
|
Specifies that the editable combobox should not allow typing a value that is
not present in the combobox model. The value should be either Boolean.TRUE or Boolean.FALSE.
At runtime, the value is taken from:
JComboBox comboCompletionModelOnlyTest = new JComboBox(
![]() ![]() |
|
|
|
Specifies the custom password strength checker on a JPasswordField. Should be set on the specific
JPasswordField. The value should be an instance of a class that implements the
org.jvnet.lafwidget.text.PasswordStrengthChecker interface.
Sample custom implementation:
jpf.putClientProperty(LafWidget.PASSWORD_STRENGTH_CHECKER,
And the result is: ![]() |
|
|
|
The org.jvnet.lafwidget.tabbed.TabPreviewPainter
class provides an option to have a tab overview button. The
org.jvnet.lafwidget.tabbed.DefaultTabPreviewPainter provides a default
implementation of this abstract class. In order to set the tab preview painter, use client property
LafWidget.TABBED_PANE_PREVIEW_PAINTER on either tabbed pane
or globally on UIManager. Value should be an instance of the above class. Once this property is
set, the tabbed pane will show an overview button (situated according to the tab placement). Shown below
is the tab with tab overview button on TOP and BOTTOM placement:
![]() ![]() When the tab overview button is clicked, the tab overview dialog is shown and a separate thread starts populating this dialog with preview thumbnails of all the tab components: ![]() Clicking on a tab thumbnail closes the tab overview dialog and selects the matching tab component. Basic rollover effects and tooltip messages are provided on the tab overview widgets. In addition, this property can enable a tab preview window that will be shown when the mouse hovers over a tab. The tabbed pane will show preview window of the tab under mouse (aligned according to the tab placement): ![]() The screenshots above are from a tabbed pane that has the client property set to:
jtp.putClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER,
where org.jvnet.lafwidget.tabbed.DefaultTabPreviewPainter is the default (reference) implementation:
public class DefaultTabPreviewPainter extends TabPreviewPainter {
Sample implementation that specifies tab overview that is updated periodically (every 3 seconds):
jtp.putClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER,
|
|
|
|
Specifies that a text component should select all its contents on focus gain.
The value should be either Boolean.TRUE (behaviour present)
or Boolean.FALSE and can be set either on a specific
text component or globally on UIManager.
Example of creating a text field that selects all its contents on focus gain:
JTextField jtf4 = new JTextField("select all on focus");
The result is: ![]() |
|
|
|
Specifies that a text component should have edit context menu. The value should
be either Boolean.TRUE (behaviour present)
or Boolean.FALSE and can be set either on a specific
text component or globally on UIManager. Example of creating a text field
with edit context menu:
JTextField jtf5 = new JTextField("edit context menu");
The result is: ![]() |
|
|
|
Specifies that a tree should provide automatic drag-n-drop (DnD) support. The value should
be either Boolean.TRUE (behaviour present)
or Boolean.FALSE and can be set either on a specific
tree or globally on UIManager. Example of creating a tree
with automatic DnD support:
tree.putClientProperty(LafWidget.TREE_AUTO_DND_SUPPORT,
The result is - the first screenshot shows the drop enabled (gson21 is being dragged), while the second screenshot shows the drop disabled (gson11 is being dragged under one of its children): ![]() ![]() |
|