1 18 19 package sync4j.syncclient.demo; 20 21 import java.awt.BorderLayout ; 22 import java.awt.Button ; 23 import java.awt.Frame ; 24 import java.awt.GridLayout ; 25 import java.awt.Image ; 26 import java.awt.Label ; 27 import java.awt.Panel ; 28 import java.awt.Toolkit ; 29 30 import java.awt.event.ActionEvent ; 31 import java.awt.event.ActionListener ; 32 import java.awt.event.WindowEvent ; 33 import java.awt.event.WindowListener ; 34 35 42 public class About 43 extends Frame 44 implements 45 ActionListener , 46 WindowListener , 47 ConfigurationParameters { 48 49 51 53 private MainWindow mw = null ; 57 58 private Language ln = new Language() ; 59 60 62 public About(MainWindow mw) { 63 64 super (); 65 setTitle (ln.getString("about_funambol")); 66 67 Image icon = Toolkit.getDefaultToolkit().getImage(FRAME_ICONNAME); 68 69 setIconImage(icon); 70 71 Label lb1 = null ; 72 Label lb2 = null ; 73 Label lb3 = null ; 74 Label lb4 = null ; 75 76 Button butOk = null ; 77 Panel textPanel = null ; 78 79 this.mw = mw; 80 81 setSize (300, 150 ) ; 82 setLocation (400, 200 ) ; 83 setLayout(new BorderLayout ()); 84 85 lb1 = new Label ("" , Label.CENTER ) ; 86 lb2 = new Label (ln.getString ("sync_client_pim" ) , Label.CENTER ) ; 87 lb3 = new Label (ln.getString ("copyright" ) , Label.CENTER ) ; 88 lb4 = new Label (ln.getString ("copyright_url" ) , Label.CENTER ) ; 89 90 butOk = new Button (ln.getString ("ok" ) ) ; 91 butOk.setActionCommand ("ok" ) ; 92 butOk.addActionListener (this ) ; 93 94 textPanel = new Panel (); 95 textPanel.setLayout(new GridLayout (4,1)); 96 97 textPanel.add (lb1 ) ; 98 textPanel.add (lb2 ) ; 99 textPanel.add (lb3 ) ; 100 textPanel.add (lb4 ) ; 101 102 add(textPanel , BorderLayout.CENTER ) ; 103 add(butOk , BorderLayout.SOUTH ) ; 104 105 addWindowListener(this); 106 } 107 108 public void actionPerformed(ActionEvent evt) { 109 110 if (evt.getActionCommand().equals("ok")) { 111 mw.setEnabled(true); 112 hide(); 113 } 114 115 } 116 117 public void windowClosing(WindowEvent evt) { 118 mw.setEnabled(true); 119 hide(); 120 } 121 122 public void windowActivated (WindowEvent e) {} 123 124 public void windowClosed (WindowEvent e) {} 125 126 public void windowDeactivated (WindowEvent e) {} 127 128 public void windowDeiconified (WindowEvent e) {} 129 130 public void windowIconified (WindowEvent e) {} 131 132 public void windowOpened (WindowEvent e) {} 133 134 136 } | Popular Tags |