Re: Help Cloning Objects
- From: Dieter Lamberty <news.10.dieterl@xxxxxxxxxxxxxxx>
- Date: Sun, 27 Aug 2006 10:56:51 +0200
Bill schrieb:
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
Hi Bill
What you would like to have is a clone of the data, not a clone of the
panel.
So you should clone the data in the table by either cloning the (your)
TableModels or the data contained in it.
First you have to make your class implement the Cloneable Interface and
implement the clone method as public. This is what the error message says...
Hope that helps
Dieter
.
- References:
- Help Cloning Objects
- From: Bill
- Help Cloning Objects
- Prev by Date: Re: html in a textfield
- Next by Date: Re: html in a textfield
- Previous by thread: Help Cloning Objects
- Next by thread: having much space in menus before the icon
- Index(es):
Relevant Pages
|