“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” (Mosher's Law of Software Engineering)
“If debugging is the process of removing bugs, then programming must be the process of putting them in.” (Edsger Dijkstra)
Paul Clapham wrote:The phrase "group box" doesn't ring any bells with me. But if you want a form which can show a variety of panels depending on the context, then a CardLayout does that sort of thing.
I don't see why it's an extra burden to keep track of what should be visible; surely no matter what solution you use, you're going to have to say which panel is currently supposed to be visible?
Anyway here's a link to the tutorial: How to Use CardLayout.
Paul Clapham wrote:Oh, okay, so "group box" is just an ordinary JPanel then.
Paul Clapham wrote:XYLayout??? No, no, no, read the tutorial about Using Layout Managers. Laying out your components pixel by pixel looks good to beginners because things seem to work right, but you can only really pull it off if you already know how to use layout managers.
Let me move this post to the Swing forum where the real Swing experts hang out.
Paul Clapham wrote:Yeah, that's what all the beginners say.
Consider Paul's rocket mass heater. |