Class GuiUtils


  • public class GuiUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GuiUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addKeyListener​(java.awt.Component component, java.awt.event.KeyListener listener)
      Adds a KeyListener to given component recursively.
      static java.awt.Font loadFontResource​(java.lang.String path, java.lang.Class<?> resourceClass, int size)
      Loads a true-type font from a resource
      static void removeKeyListener​(java.awt.Component component, java.awt.event.KeyListener listener)
      Removes given KeyListener from a component recursively.
      • Methods inherited from class java.lang.Object

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

      • GuiUtils

        public GuiUtils()
    • Method Detail

      • addKeyListener

        public static void addKeyListener​(java.awt.Component component,
                                          java.awt.event.KeyListener listener)
        Adds a KeyListener to given component recursively.
        Parameters:
        component - GUI component
        listener - KeyListener object
      • removeKeyListener

        public static void removeKeyListener​(java.awt.Component component,
                                             java.awt.event.KeyListener listener)
        Removes given KeyListener from a component recursively.
        Parameters:
        component - GUI component
        listener - KeyListener object
      • loadFontResource

        public static java.awt.Font loadFontResource​(java.lang.String path,
                                                     java.lang.Class<?> resourceClass,
                                                     int size)
        Loads a true-type font from a resource
        Parameters:
        path - Resource path
        size - Default font size
        resourceClass - class where to look for resources
        Returns:
        loaded font, or Font.MONOSPACED if the font could not be loaded