32 lines
725 B
Plaintext
32 lines
725 B
Plaintext
public void saveAgenda(File file) {
|
|
try {
|
|
FileOutputStream fos = new FileOutputStream(file);
|
|
ObjectOutputStream oos = new ObjectOutputStream(fos);
|
|
oos.writeObject(this);
|
|
oos.close();
|
|
JOptionPane.showMessageDialog(null, "Saved succesfully");
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
public void fillAgenda(File file) {
|
|
FileInputStream fis = null;
|
|
ObjectInputStream ois = null;
|
|
try {
|
|
|
|
fis = new FileInputStream(file);
|
|
ois = new ObjectInputStream(fis);
|
|
|
|
Object object;
|
|
object = ois.readObject();
|
|
Agenda a = (Agenda) object;
|
|
events = a.getEvents();
|
|
stages = a.getStages();
|
|
artists = a.getArtists();
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
|
|
}
|