class CloneClass implements Cloneable{
public int aInt;
public Object clone(){
CloneClass o = null;
try{
o = (CloneClass)super.clone();
}catch(CloneNotSupportedException e){
e.printStackTrace();
}
return o;
}
}
-----------------------------------------------
ByteArrayOutputStream
byteOut = new ByteArrayOutputStream();
ObjectOutputStream out
= new ObjectOutputStream(byteOut);
out.writeObject(combo);
ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray());
ObjectInputStream in
=new ObjectInputStream(byteIn);
JComboBox comb2 = (JComboBox)in.readObject();
|
|