Scroll « Button « Java Swing Q&A





2. Adding Scrolling Functionality to Button    coderanch.com

Well you probably shouldn't be using a GridLayout. The panel does not automatically change size as components are added to it. Instead the components are resized to fill the spac of the panel. You should probably be usinging a BoxLayout, which is easily done by using: Box panel = Box.getVerticalBox(); panel.add(component1); panel.add(component2); As you add components to the Box you need ...