Class Sticky


  • public class Sticky
    extends java.lang.Object
    Sticky is a helper class to make JList or JTree or JTable changing selection when mouse moves. To use it, you simply call
    
     JList list = new JList();
     new Sticky(list);
     
    or
    
     JTree tree = new JTree();
     new Sticky(tree);
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Sticky​(javax.swing.JList list)  
      Sticky​(javax.swing.JTable table)  
      Sticky​(javax.swing.JTree tree)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void install()
      Installs the listener to make the list or tree sticky.
      void uninstall()
      Uninstalls the listener.
      • Methods inherited from class java.lang.Object

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

      • Sticky

        public Sticky​(javax.swing.JList list)
      • Sticky

        public Sticky​(javax.swing.JTree tree)
      • Sticky

        public Sticky​(javax.swing.JTable table)
    • Method Detail

      • install

        public void install()
        Installs the listener to make the list or tree sticky. This method is called by constructor, so you don't need to call it unless you called uninstall() to remove the listener.
      • uninstall

        public void uninstall()
        Uninstalls the listener.