File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes animation in scrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "animation in scrollPane" Watch "animation in scrollPane" New topic

animation in scrollPane

dejie lin
Ranch Hand

Joined: Jan 29, 2003
Posts: 31
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
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

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.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Consider Paul's rocket mass heater.
subject: animation in scrollPane
It's not a secret anymore!