Hi, I am wondering if having too many panels to make the desire look on the front end is bad? I know nested HTML table is bad, what about nesting panels in Swing? I have left my assignment for another few months now avoiding Swing. Does anybody know some good links on good practices on Swing? Not just how to use it.
posted 11 years ago
Nested panels are a good thing. To some degree you are expected to leverage nested panels for complex GUIs. But more importantly, if you're clever you can separate functionality, or easily reuse a nested panel, either by using methods or extended classes:
Here's a contrived example:
Now this application (at least, mine) isn't really that big to warrant something like that, BUT, it is useful to have something like this:
That and some good documentation should (once again, I suspect) get you points for code clarity.