Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getContainer in a JFrame

804807Oct 12 2010 — edited Oct 23 2010
Hi,

I recently wrote a JFrame based app that added components (eg. pushbuttons and JPanels) directly to the JFrame object.

This all seemed to work.

The only time I hit a problem was when I tried to change the panel and the remove API didn't work.

I then discovered that I should do a getContentPane and add the components to that.

So, what are the other side effects that I would/could have encountered had I left my code adding components directly to the JFrame object?

Thanks
Gary
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2010
Added on Oct 12 2010
5 comments
169 views