I would like to know how to smooth the automatic transition of a JScrollPane. I'm using
JScrollBar scroll = scollpane.getVerticalScrollBar();
scroll.setValue(scroll.getMaximum());
Something like JScrollPane.setUnitIncrement(inc)
with inc values of ~0.001 and a 10ms delay between increments would help, I guess, but setUnitIncrement
only takes int
s.
Also, I want the same smooth animation for adding an element like JList
to a JPanel
with BoxLayout
. I'd like it to have a smooth top-to-bottom appearance, not instantly being displayed when using JPanel.add(JList)
.
I'm mostly looking towards an implementation of AurelienRibon's SlidingLayout
or Tween
, but I can't wrap my head around it.