Angel.java
1 /**
2 * @author Juan David Marin
3 */
4
5 import java.awt.event.*;
6 import java.io.FileNotFoundException;
7 import java.io.FileOutputStream;
8 import java.io.IOException;
9 import java.io.ObjectOutputStream;
10
11
12 public class GestionVentana implements WindowListener {
13 private ListaPuntajes listaPuntajes;
14 public GestionVentana(ListaPuntajes listaPuntajes2){
15 listaPuntajes = listaPuntajes2;
16 }
17 public void windowActivated(WindowEvent e) {
18
19 }
20
21 public void windowClosed(WindowEvent e) {
22 // TODO Auto-generated method stub
23
24 }
25
26 public void windowClosing(WindowEvent e) {
27
28 try {
29 ObjectOutputStream archivo = new ObjectOutputStream(new FileOutputStream(Constantes.nombreArchivo));
30 archivo.writeObject(listaPuntajes);
31 archivo.close();
32 } catch (FileNotFoundException e1) {
33 // TODO Auto-generated catch block
34 e1.printStackTrace();
35 } catch (IOException e1) {
36 // TODO Auto-generated catch block
37 e1.printStackTrace();
38 }
39
40 System.exit(0);
41 }
42
43 public void windowDeactivated(WindowEvent e) {
44 // TODO Auto-generated method stub
45
46 }
47
48 public void windowDeiconified(WindowEvent e) {
49 // TODO Auto-generated method stub
50
51 }
52
53 public void windowIconified(WindowEvent e) {
54 // TODO Auto-generated method stub
55
56 }
57
58 public void windowOpened(WindowEvent e) {
59
60
61 }
62
63 }
CategoryJava | CategoryProgramacion
