View Single Post
  #1 (permalink)  
Old April 27th, 2004, 01:38 PM
philip philip is offline
Registered User
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default scrolling scrollpane

ive got the opposite problem to natmaster.
i am using a JEditorPane inside a JScrollPane.
When i load a URL into it using setPage(URL url), the top of the page stays in view. this is how i want it.

However, I also call setText(String text) in a different function.
in this case, the pane scrolls to the bottom, instead of remaining at the top, as i would like.

I tried cheating and calling scrollRectToVisible(Rectangle contentRect) on the scrollpane viewport using a rectangle with coordinates at (0,0), but this did not make a difference.

Does anyone have any other ideas how I could keep the scrollbar at the top of the page?


Reply With Quote