Class ScrollCorrector

java.lang.Object
gov.nih.mipav.view.ScrollCorrector
All Implemented Interfaces:
AdjustmentListener, EventListener

public class ScrollCorrector extends Object implements AdjustmentListener
Corrects a strange behaviour with JScrollPane when lines are appended from another thread. Moves the vertical slider to the last position.

usage: add as an adjustment listener to the VerticalScrollBar, eg., scrollPane.getVerticalScrollBar().addAdjustmentListener(new ScrollCorrector());

Taken as a modified version from traiton , on Sun's bug parade. See: JTextArea's don't automatically scoll when appending() to them. 20 February 2001 entry.

Modified as needed.

Author:
traiton
  • Field Details

    • atLastPos

      private boolean atLastPos
      DOCUMENT ME!
    • lastMax

      private int lastMax
      DOCUMENT ME!
  • Constructor Details

    • ScrollCorrector

      public ScrollCorrector()
      Does nothing.
  • Method Details