Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AWT Scroll problem  RSS feed

 
Alex Belt
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the situation. Inside a ScrollPane, I have a Panel. Inside that panel are numerous other panels, which contain components. These components are sized and placed using the setBounds() method, as they need to be left justified. Using a layout manager causes incorrect component positioning, even a GridBagLayout. Because the components are laid out using setBounds, everything except the panel placed in the ScrollPane has to be positioned and sized using setBounds. Unfortunately, this causes the ScrollPane to function incorrectly, because it thinks the Panel that contains all the display components doesn't require scrolling, even if it does. I need to either figure out a way to lay out the components so that I don't have to use setBounds, or I need to figure out how to scroll the ScrollPane programmatically. Can someone please point me in the right direction?
Thanks,
Alex
 
Alex Belt
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, I discovered I needed to use validate()rather than repaint() for updating the ScrollPane.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!