Class MarqueePane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants

public class MarqueePane extends JScrollPane
MarqueePane is a subclass of JScrollPane with automation of scrolling. In MarqueePane, you can define the direction you want the component inside the MarqueePane to scroll to and the scrolling speed.
See Also:
  • Field Details

  • Constructor Details

    • MarqueePane

      public MarqueePane(Component view)
    • MarqueePane

      public MarqueePane()
  • Method Details

    • updateUI

      public void updateUI()
      Overrides:
      updateUI in class JScrollPane
    • getScrollDelay

      public int getScrollDelay()
      Get the scroll frequency which indicating how frequent the Marquee will get repaint.

      The default value is 100ms.

      Returns:
      the scroll frequency.
    • setScrollDelay

      public void setScrollDelay(int scrollDelay)
      Set the scroll frequency which indicating how frequent the Marquee will get repaint.
      Parameters:
      scrollDelay - the scroll frequency
    • getScrollAmount

      public int getScrollAmount()
      Get the scroll amount between two repaints.

      The default value is 2.

      Returns:
      the step size.
    • setScrollAmount

      public void setScrollAmount(int scrollAmount)
      Set the scroll amount between two repaints.
      Parameters:
      scrollAmount - the step size
    • getScrollDirection

      public int getScrollDirection()
      Get the scroll direction.

      The value could be SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, SCROLL_DOWN

      The default value is SCROLL_LEFT.

      Returns:
      the scroll direction.
    • setScrollDirection

      public void setScrollDirection(int scrollDirection)
      set the scroll direction.
      Parameters:
      scrollDirection - the scroll direction
    • getStayDelay

      public int getStayDelay()
      Gets delay time when it reaches a stay position.

      The default value is 500ms.

      Returns:
      the delay time when it reaches a stay position..
    • setStayDelay

      public void setStayDelay(int stayDelay)
      Sets stay delay time when it reaches a stay position.
      Parameters:
      stayDelay - the delay time when it reaches a stay position.
    • stopAutoScrolling

      public void stopAutoScrolling()
      Stop auto scrolling. The view will stay where it is.
    • startAutoScrolling

      public void startAutoScrolling()
      Start auto scrolling.
    • getStayPosition

      public int getStayPosition()
      Get stay position.

      With this field, you can let the scrolling stop for getStayTime after scrolling getStayPosition times.

      The default value is -1, which means no stay position in the middle.

      Returns:
      the stay position.
    • setStayPosition

      public void setStayPosition(int stayPosition)
      Set stay position.
      Parameters:
      stayPosition - the stay position