Class SelectAllOnFocusGainedDecorator

  • All Implemented Interfaces:
    java.awt.event.FocusListener, java.util.EventListener

    public class SelectAllOnFocusGainedDecorator
    extends java.awt.event.FocusAdapter
    A helper class that selects all text as soon as a JTextComponent receives focus.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void decorate​(javax.swing.text.JTextComponent tc)
      Add the listener to a given text component.
      void focusGained​(java.awt.event.FocusEvent e)  
      • Methods inherited from class java.awt.event.FocusAdapter

        focusLost
      • Methods inherited from class java.lang.Object

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

      • decorate

        public static void decorate​(javax.swing.text.JTextComponent tc)
        Add the listener to a given text component.
        Parameters:
        tc - The text component.
      • focusGained

        public void focusGained​(java.awt.event.FocusEvent e)
        Specified by:
        focusGained in interface java.awt.event.FocusListener
        Overrides:
        focusGained in class java.awt.event.FocusAdapter