Class BaseScrollPane

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

public class BaseScrollPane extends JScrollPane
JScrollPane with proper scroll unit/block increments.
Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
  • Field Details

    • UNIT_INCREMENT

      public static final int UNIT_INCREMENT
      the default unit increment for the scrollbars.
      See Also:
    • BLOCK_INCREMENT

      public static final int BLOCK_INCREMENT
      the default block increment for the scrollbars.
      See Also:
  • Constructor Details

    • BaseScrollPane

      public BaseScrollPane()
      Creates an empty (no viewport view) JScrollPane where both horizontal and vertical scrollbars appear when needed.
    • BaseScrollPane

      public BaseScrollPane(int vsbPolicy, int hsbPolicy)
      Creates an empty (no viewport view) BaseScrollPane with specified scrollbar policies. The available policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int) and JScrollPane.setHorizontalScrollBarPolicy(int).
      Parameters:
      vsbPolicy - an integer that specifies the vertical scrollbar policy
      hsbPolicy - an integer that specifies the horizontal scrollbar policy
    • BaseScrollPane

      public BaseScrollPane(Component view)
      Creates a BaseScrollPane that displays the contents of the specified component, where both horizontal and vertical scrollbars appear whenever the component's contents are larger than the view.
      Parameters:
      view - the component to display in the scrollpane's viewport
    • BaseScrollPane

      public BaseScrollPane(Component view, int vsbPolicy, int hsbPolicy)
      Creates a BaseScrollPane that displays the view component in a viewport whose view position can be controlled with a pair of scrollbars. The scrollbar policies specify when the scrollbars are displayed, For example, if vsbPolicy is VERTICAL_SCROLLBAR_AS_NEEDED then the vertical scrollbar only appears if the view doesn't fit vertically. The available policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int) and JScrollPane.setHorizontalScrollBarPolicy(int).
      Parameters:
      view - the component to display in the scrollpanes viewport
      vsbPolicy - an integer that specifies the vertical scrollbar policy
      hsbPolicy - an integer that specifies the horizontal scrollbar policy
  • Method Details

    • initialize

      protected void initialize()
      Initializes the scrollpane.
    • setScrollBarUnitIncrement

      public void setScrollBarUnitIncrement(int inc)
      Sets the unit increments of both bars.
      Parameters:
      inc - the increment to use
      See Also:
    • setScrollBarBlockIncrement

      public void setScrollBarBlockIncrement(int inc)
      Sets the block increments of both bars.
      Parameters:
      inc - the increment to use
      See Also: