1 26 27 28 package org.objectweb.mobilitools.util.gui; 29 30 31 import java.awt.*; 32 import java.awt.event.*; 33 34 35 public class AlertFrame extends Frame implements ActionListener 36 { 37 Button boutonOK; 38 39 40 46 public AlertFrame(String title, String message, String button) 47 { 48 super(title); 49 50 setLayout(new BorderLayout()); 51 TextArea texte = new TextArea(message, 5, 30); 52 texte.setEditable(false); 53 add("Center", texte); 54 add("South", boutonOK = new Button(button)); 55 boutonOK.addActionListener(this); 56 addWindowListener(new OnWindowClosing()); 57 pack(); 58 show(); 59 } 60 61 62 66 67 public void actionPerformed(ActionEvent evt) 68 { 69 dispose(); 70 } 71 72 73 77 78 class OnWindowClosing extends WindowAdapter 79 { 80 public void windowClosing(WindowEvent e) 81 { 82 AlertFrame.this.dispose(); 83 } 84 } 85 } 86 | Popular Tags |