Package net.sf.gridarta.gui.utils
Class SwingUtils
- java.lang.Object
-
- net.sf.gridarta.gui.utils.SwingUtils
-
public class SwingUtils extends java.lang.ObjectUtility class for Swing related functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddAction(@NotNull javax.swing.JComponent textComponent, @NotNull javax.swing.Action action)Adds an accelerator key for a component.static @NotNull java.awt.ComponentcreateLabel(@NotNull java.lang.String key, @Nullable java.awt.Component component)Creates aJLabelinstance.
-
-
-
Method Detail
-
createLabel
@NotNull public static @NotNull java.awt.Component createLabel(@NotNull @NotNull java.lang.String key, @Nullable @Nullable java.awt.Component component)Creates aJLabelinstance.- Parameters:
key- the action key to usecomponent- the component this label is attached to- Returns:
- the label
-
addAction
public static void addAction(@NotNull @NotNull javax.swing.JComponent textComponent, @NotNull @NotNull javax.swing.Action action)Adds an accelerator key for a component. The accelerator key is extracted from the action to be added. If the action has no attached accelerator key, nothing is added.- Parameters:
textComponent- the text component to add toaction- the action to add
-
-