JScrollBar « Layout « Java Swing Q&A





1. Programmatically set the knob position of a JScrollBar    coderanch.com

Thanks for the answer... but, well, I forgot to mention it, but: I need to adjust the knob position OUTSIDE a adjustementListener. I need to do something like this: int oldValue = scrollPagina.getVerticalScrollBar().getModel().getValue(); //after some operations that change the knob position... (selecting text, etc.) scrollPagina.getVerticalScrollBar().getModel().setValue(oldValue); This doesn't work. ONLY inside the listener... someonde could explain this behaviour? And what can I ...

2. JScrollBar... how to set the position of the scrollbar?    java-forums.org

hello, below is the source code. it is setLocation(), not setPosition(). my mistake. ah, i found out that setLocation() doesnt move the scroll thing, but moves the whole thing instead. so, how do i make the scrollbar start by scrolling to the right instead of the default left? Java Code: import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.DateAxis; import org.jfree.chart.axis.DateTickMarkPosition; import org.jfree.chart.axis.NumberAxis; import ...

4. JScrollBar with a GridLayout?    forums.oracle.com

I have a question if this is possible: I have a grid layout of 9X4 JPanels, but all of the information in the panels take up more space than I would like to have my JFrame, so I was wondering if a scrollBar would be possible to implement? I wasn't sure because the grids automatically adjust their size depending on the ...