Top « JScrollPane « Java Swing Q&A





1. Java Swing - Using JScrollPane and Having it scroll back to top    stackoverflow.com

I'm using JScrollPane to allow scrolling in a JFrame that has a text component that's serving as a text editor. What I want to do, after setting the text in ...

2. JScrollPane adding JPanels at the top and keeping current scroll view    stackoverflow.com

I have a JScrollPane that contains a vertical Box. I'm inserting new JPanel's at the top of Box. If I use the scrollbar to scroll down I'd like for the current ...

3. How do I add space to a JPanel, so that JScrollPane doesn't sit on top of my components?    stackoverflow.com

I have a JScrollPane and when I load my application the bar is sitting on top of one of my buttons. What I would like to do is add some ...

4. The Vertical JScrollPane does not stay on the top    stackoverflow.com

The vertical scrollbar when added to a panel does not stay on the top when the panel is updated with different components like textarea. The scroll bar relocates itself to a ...

7. ScrollPane to top - that old chesnut...    coderanch.com

Not the viewport, but the component inside the viewport should be the one you call scrollRectToVisible() on... import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; public class ScrollIt { private JFrame f; private JScrollPane scroll; public ScrollIt() { f = new JFrame( "ScrollIt" ...

8. How to get JScrollPane to go to top left??    coderanch.com

I added your code in and put a print statement prior to and after the call to show. Both indicate that the position of the vertical scroll is zero and yet the scroll bar is at the bottom of the panel. Very confusing to me. I have gone back again to make sure that I am using the correct panel and ...

9. How to scroll to top of JScrollPane    coderanch.com





10. Set scrollbar to top    coderanch.com

I want my vertical scroll bar to initialize to the top but it always seems to start somewhere a few pixels from the bottom. I thought that this was the way to do it... (html view is a JScrollPane) htmlView.getVerticalScrollBar().setValue(0); int val = htmlView.getVerticalScrollBar().getValue(); System.out.println("Value of scrollbar is " + val); ...but it always prints 0 while putting the scroller near ...

11. How do you make the scrollbar to be at the top of the scrollpane by default    coderanch.com

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ...

13. JScrollPane adding JPanels at the top and keeping current scroll view    coderanch.com

I have a JScrollPane that contains a vertical Box. I'm inserting new JPanel's at the top of Box. If I use the scrollbar to scroll down I'd like for the current view to remain where I scrolled down to. For example, if I have 50 panels in the box and use the scrollbar to view panel 20, I'd like the view ...

14. Default JScrollPane At The Top    java-forums.org

I have a problem regarding a JScrollPane on my JTextArea. When I paste text into the TextArea, the ScrollBar automatically scrolls to the bottom of the textbox. I want the ScrollBar to stay at the top of the textbox when I paste text into the box. How can I set the ScrollBar to stay at the top of the textarea when ...