scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { e.getAdjustable().setValue(e.getAdjustable().getMaximum()); } });
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }
adjustmentEvent.getAdjustable().setBlockIncrement(100); adjustmentEvent.getAdjustable().setUnitIncrement(100);
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }
adjustmentEvent.getAdjustable().setBlockIncrement(100); adjustmentEvent.getAdjustable().setUnitIncrement(100);
messageScrollList.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { e.getAdjustable().setValue(e.getAdjustable().getValue()); } });
scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { public void adjustmentValueChanged(AdjustmentEvent e) { e.getAdjustable().setValue(e.getAdjustable().getMaximum()); } });
adjustmentEvent.getAdjustable().setBlockIncrement(100); adjustmentEvent.getAdjustable().setUnitIncrement(100);
public void adjustmentValueChanged(AdjustmentEvent e){ String name = ((JScrollbar)e.getAdjustable()).getName(); if ("a".equals(name)) { // do a something } else if ...
public void adjustmentValueChanged(AdjustmentEvent e) { if (lockable || lastScrollAmount != 0) { scrollLock = (e.getValue() == e.getAdjustable().getMaximum() - e.getAdjustable().getVisibleAmount()); return; } lastScrollAmount = 0; if (scrollLock) e.getAdjustable().setValue(e.getAdjustable().getMaximum()); } });
scrollPane.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent event) { JScrollBar scrollBar = (JScrollBar) event.getAdjustable(); int extent = scrollBar.getModel().getExtent(); System.out.println("1. Value: " + (scrollBar.getValue() + extent) + " Max: " + scrollBar.getMaximum()); } });
@Override public void adjustmentValueChanged(AdjustmentEvent e) { final int value = e.getValue(); final Adjustable adjustable = e.getAdjustable(); final int maximum = adjustable.getMaximum(); if (value != maximum) adjustable.setValue(maximum); } });
private void scrollToBottom(JScrollPane scrollPane) { JScrollBar verticalBar = scrollPane.getVerticalScrollBar(); AdjustmentListener downScroller = new AdjustmentListener() { @Override public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable adjustable = e.getAdjustable(); adjustable.setValue(adjustable.getMaximum()); verticalBar.removeAdjustmentListener(this); } }; verticalBar.addAdjustmentListener(downScroller); }
public void run() { if(evt.getAdjustable() == vertical) setFirstLine(vertical.getValue()); else setHorizontalOffset(-horizontal.getValue()); } });
public void run() { if(evt.getAdjustable() == vertical) setFirstLine(vertical.getValue()); else setHorizontalOffset(-horizontal.getValue()); } });
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }
public void adjustmentValueChanged(AdjustmentEvent e) { Adjustable bar = e.getAdjustable(); int currentMaximum = bar.getMaximum(); if (bar.getMaximum() == _lastMaximum) { return; // nothing to do, the adjustable has not expanded } int bottom = bar.getValue() + bar.getVisibleAmount(); if (bottom + bar.getUnitIncrement() >= _lastMaximum) { bar.setValue(bar.getMaximum()); // use the most recent maximum } _lastMaximum = currentMaximum; }