Scroll dissapears when resizing window without showing the whole content
posted 3 years ago
I have a problem with a scrollbar. I have searched for solutions but without any progress.
The problem is that I'm using a paintcomponent in a panel. The "paintcomponent" exceeds the size of the screen so I added a scroll, but the scroll disappear when i resize the window and I'm not able to see the whole content.
Could someone please help me? What am I doing wrong?
The problem is with the preferredSize set for the panel. Scrollbar works based on this. So, you have to set the preferred size in such a way to show the content. For example, when I set a preferred width of 2000 or so, I am able to see the full content.