/** Invoked when the component's size changes. Reset scrollable increment, because * page-down/up is relative to current view size. */ public void componentResized(ComponentEvent e) { JScrollBar bar = getVerticalScrollBar(); // NOTE: use the scroll pane size--the XHTMLPanel size is a virtual size of the entire // page // want to page down leaving the current line at the bottom be the first at the top // TODO: this will only work once unit increment is set correctly; multiplier is a workaround (PWW 28-01-05) int incr = (int)(getSize().getHeight() - (bar.getUnitIncrement(1) * 3)); getVerticalScrollBar().setBlockIncrement(incr); } });
/** Invoked when the component's size changes. Reset scrollable increment, because * page-down/up is relative to current view size. */ public void componentResized(ComponentEvent e) { JScrollBar bar = getVerticalScrollBar(); // NOTE: use the scroll pane size--the XHTMLPanel size is a virtual size of the entire // page // want to page down leaving the current line at the bottom be the first at the top // TODO: this will only work once unit increment is set correctly; multiplier is a workaround (PWW 28-01-05) int incr = (int)(getSize().getHeight() - (bar.getUnitIncrement(1) * 3)); getVerticalScrollBar().setBlockIncrement(incr); } });