Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

animation in scrollPane

 
dejie lin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all
By some reasons, i have to draw a very long long gragh, let's say it is much wider than 5000 pixels, Then i put the graph into a scrollpane, how can i make the "animation" so that the graph can move to left automatically, just like user is draging the scrollbar of the panel to have a look the graph?
thanks in advace
dejie
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's some code I have that graphs the used memory of the JVM... it has a graph in a scrollpane that follows the graph. Check out the addData() method. Especially the scrollRectToVisible() call.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic