Compartmentalizing your swing components allows you to take advantage of the
many layout managers at your disposal. As for pros and cons, I think that
you must decide what is right for your application. A simple GUI may not
need so much layering, you know?
"Joseph" <na@na.ca> wrote in message
news:pt****************@twister01.bloor.is.net.cab le.rogers.com...
Can anyone explain to me the benefit of using a JPanel and adding it to a
JFrame ; where all the components(buttons,etc.) are added to JPanel.
Compared to skipping the JPanel and just adding the components to a
JFrame. I find that the book I am reading seems to use JPanels quite a bit but
doesn't state why. Thank you in advance.