File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 174
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
- 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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic