This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "animation in scrollPane" Watch "animation in scrollPane" New topic
Author

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
dejie
Nathan Pruett
Bartender

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.



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
 
subject: animation in scrollPane
 
Similar Threads
Scroll ........i need help
graph
graph
JComboBox - listeners
repaint() problem