Need Swing Layout Advice
I'm creating a Java app that is going to be used as a survey tool. I'm creating the user interface based on XML data. I'm thinking each question will have it's own panel and then I'd like to stack the panels on top of each other. Ideally I'd like scroll bar so I can keep the window size constant.
Is there a way to do this in Swing and what LayoutManager would work best for this situation
You can swap JPanels with a CardLayout which sounds most intuitive to me. Otherwise you seem to be describing a GridLayout. Realize though that most GUI's that are more than the most simplistic will do best with nested JPanels, each using its own layout.
The cardlayout is a good approach, if you google java 21 days you can find example source code of a survey somewhere in the books pages