Class SwingUtils


  • public class SwingUtils
    extends java.lang.Object
    Utility class for Swing related functions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addAction​(@NotNull javax.swing.JComponent textComponent, @NotNull javax.swing.Action action)
      Adds an accelerator key for a component.
      static @NotNull java.awt.Component createLabel​(@NotNull java.lang.String key, @Nullable java.awt.Component component)
      Creates a JLabel instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createLabel

        @NotNull
        public static @NotNull java.awt.Component createLabel​(@NotNull
                                                              @NotNull java.lang.String key,
                                                              @Nullable
                                                              @Nullable java.awt.Component component)
        Creates a JLabel instance.
        Parameters:
        key - the action key to use
        component - 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 to
        action - the action to add