posted 14 years ago
For those who came across this (as I did), wanted to post a follow-on solution. The code above works because there is no layout manager, which is uncommon for larger projects. Here's the same block using a common layout manager, MigLayout (not using any of its bells and whistles), and the SwingX implementation of JXPanel. Note that JXPanel can be easily replaced with JPanel, just remove the additional lines that tell the panel not to recalculate its size dynamically, but to enforce the scrollable region.