Caricamento... try {
// Deserializza da un file
File file = new File("user.ser");
ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
// Deserializza l'oggetto
javax.swing.JButton button = (javax.swing.JButton) in.readObject();
in.close();
// Deserializza da un array di bit
in = new ObjectInputStream(new ByteArrayInputStream(bytes));
button = (javax.swing.JButton) in.readObject();
in.close();
} catch (ClassNotFoundException e) {
} catch (IOException e) {
}
Lascia un commento
Copyright © 2005 - 2010 :: ianaz - created by Silvio Rainoldi