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!

how to copy JPanel to another JPanel

843810Oct 25 2005 — edited Oct 27 2005
I have a JPanel called dataPanel.
I serialize it, then I modify dataPanel, and at some point I want to revert to the serialized panel.

I'm trying to do this in the following way:
JPanel aaa = deserialize();
dataPanel = aaa;
This does not work. However, I am sure the serialization/deserialization is Ok, because if I take all components from aaa and add them to dataPanel I can see them. But in this way I loose the layout that's also serialized.

Is it possible to copy a JPanel this way (dataPanel = aaa)?
Is there some other way I can do this?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 24 2005
Added on Oct 25 2005
4 comments
1,249 views