Register / Login
Win a copy of
Java Concurrency Live Lessons
this week in the
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Swing / AWT / SWT
Setting a scroll pane's scroll bar to the top after button click?
posted 4 years ago
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
public void setViewport(JViewport jv) Removes the old viewport (if there is one); forces the viewPosition of the new viewport to be in the +x,+y quadrant; syncs up the row and column headers (if there are any) with the new viewport; and finally syncs the scrollbars and headers with the new viewport. Most applications will find it more convenient to use setViewportView to add a viewport and a view to the scrollpane. Parameters: viewport - the new viewport to be used; if viewport is null, the old viewport is still removed and the new viewport is set to null See Also: createViewport(), getViewport(), setViewportView(java.awt.Component)
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
posted 4 years ago
is only about visible
- no idea what is your goal, even is possible dont do that,
- for todays
- basically you can to put whatever to the
with transparency too, but have to reduce caused flickering by using
viewPort.setScrollMode(JViewport.BLIT_SCROLL_MODE); viewPort.setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE); viewPort.setScrollMode(JViewport.SIMPLE_SCROLL_MODE);
- have to override own
Don't get me started about those stupid
Boost this thread!
JTable and Horizontal Scroll Bar
JTextArea not appearing in JDialog
Can U Turn a JTable Sideways?
Problems when using JScrollPane to scroll JTextArea