aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Setting a scroll pane's scroll bar to the top after button click? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Setting a scroll pane Watch "Setting a scroll pane New topic
Author

Setting a scroll pane's scroll bar to the top after button click?

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 354

Okay so I have a program that resets the icons, and sets rid of a scroll bar when it resets. Now I also want it to goto the top. I believe that has to do with the viewport? I was looking at this



Any hep would be appreciated, thanks!


EDIT: Figured it out... using setViewportView and then setting the component as my panel and getting it @ the point 0,0
m Korbel
Ranch Hand

Joined: Jun 19, 2012
Posts: 150
- JViewport is only about visible Rectange from JScrollPane

- no idea what is your goal, even is possible dont do that, JViewport isnt JComponent or Container too

- for todays Java ot use JLayer (Java7) based on JXLayer (Java6)

- basically you can to put whatever to the JViewport with transparency too, but have to reduce caused flickering by using



- have to override own RepaintManager too
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting a scroll pane's scroll bar to the top after button click?
 
Similar Threads
JScrollBar/JScrollPane
Can U Turn a JTable Sideways?
JTextArea not appearing in JDialog
Problems when using JScrollPane to scroll JTextArea
JTable and Horizontal Scroll Bar