Hi Mike, I myself is doing that pattern,a main panel containing other panels on it. Well, as for my personal opinion and experience, doing that way make it easier for me to layout,separate objects and implement different event listeners on jpanel. I agree, it still works if you just paste your panel to you frame because they all come out with JComponent and all instances are inherited,therefore your work did just fine. You'll find that pattern useful later. It'll manifest. But you can still do the way you did it is still fine.
Jay On Wed, Jul 21, 2010 at 4:16 PM, Mike M. Lin <[email protected]> wrote: > In the Swing homework, the example we key off of (lunar images) is set > up with a JFrame which holds a JPanel. that JPanel acts as a container > for two other JPanel's - one to house the combo box, the other to > house the image. > > What is the purpose of the containing JPanel? I did my homework > assignment without that container and it seems to work just fine. I > just put my sub-panels directly on the JFrame. > > It seems pretty useless to me in this program. What am I missing? > > -- > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected]<javaprogrammingwithpassion%[email protected]> > For more options, visit this group at > http://groups.google.com/group/javaprogrammingwithpassion?hl=en -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
