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 {
}
---------------------------------------------------------------------------------------------------
Dieter Lamberty - 27 Aug 2006 09:56 GMT
Bill schrieb:
> Hi All,
> I currently have a database 'explorer' application - show lists of
[quoted text clipped - 22 lines]
>
> 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