A
albert kao
Is there a way to clone/copy JLabel & JComboBox objects?
Is this the only way to clone/copy JLabel?
String s = "test";
JLabel label = new JLabel(s);
pane.add(label, c);
JLabel label3 = new JLabel(s);
pane.add(label3, c);
The following test code has these compile errors:
The method clone() from the type Object is not visible
Type mismatch: cannot convert from Object to JLabel
String s = "test";
JLabel label = new JLabel(s);
pane.add(label, c);
JLabel label2 = label.clone(); // error
pane.add(label2, c);
Is this the only way to clone/copy JLabel?
String s = "test";
JLabel label = new JLabel(s);
pane.add(label, c);
JLabel label3 = new JLabel(s);
pane.add(label3, c);
The following test code has these compile errors:
The method clone() from the type Object is not visible
Type mismatch: cannot convert from Object to JLabel
String s = "test";
JLabel label = new JLabel(s);
pane.add(label, c);
JLabel label2 = label.clone(); // error
pane.add(label2, c);