Help Cloning Objects



Hi All,
I currently have a database 'explorer' application - show lists of
tables; ddl etc etc

I'd now like to be able to 'clone' a snapshot view into another
frame....


frame 1
has a jpanel_X + scroll pane + jtable with data etc


new frame 2

has a jpanel_Y - which I'd like to reflect the exact same contents as
frame 1


I've tried

panel_Y = panel_X.clone();

but get
Error(35,26): method clone() has protected access in class
java.lang.Object

I've added the Cloneable interface to jpanel_X - but I still get the
error message....

TIA

Bill

---------------------------------------------------------------------------------------------------
public class V_Db2Explorer_ListView extends JPanel
implements ActionListener, Cloneable {

.......

public interface Cloneable {

}
---------------------------------------------------------------------------------------------------




.



Relevant Pages

  • Re: Clone a generic class in a compact framework solution...
    ... Public Shared Function CloneAs Object ... Dim formatter As New BinaryFormatter ... Let's say I want to clone a sorted list: ... Public Class ClonableAndSortedCustomerList ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Clone a generic class in a compact framework solution...
    ... The CF has no BinaryFormatter class out of the box, although I believe there are 3rd party products that provide this capability. ... Dim formatter As New BinaryFormatter ... Let's say I want to clone a sorted list: ... Public Class ClonableAndSortedCustomerList ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Generic ICloneable
    ... ICloneablethen the object should be an X and you can cast directly to ... public X Clone() {... ... If you had a generic IClonable interface, ... public class MyClass: IClonable ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Test Driven Development Sample
    ... What I tried to do differently was pass to the Frame being scored the ... public class TestBowlingGame extends TestCase ... BowlingGame game; ...
    (comp.object)
  • Re: do I need to "rebuild" Windows ?
    ... >>> recent snapshot, thus reducing the rebuild time to one hour. ... >> I'm concerned that I can't get into My Documents from Windows Explorer. ... > If you don't have a "clean clone" at your disposal, ... > "good" clone on your EHD. ...
    (microsoft.public.windowsxp.general)