Can anyone help me figure out how to create a dynamically sized scrollable JPanel?
Here is a snippet of my code:
So I have already figured out that the JScrollPanel will scroll to the size of the JPanel's preferred size. Unfortunately, that doesn't help me when I add a large image to one of the JLabels inside of the JPanel at runtime. So, to achieve what I am wanting to do, I need the Scroll Pane to scroll to the ends of the JPanel, regardless of the size at the time. Any suggestions on how to do this?
Tell me if I am being unclear.