www.pudn.com > wmos.rar > wmo.java
package wmos; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** *Title:
*Description:
*Copyright: Copyright (c) 2004
*Company:
* @author not attributable * @version 1.0 */ public class wmo extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); JButton jButton1 = new JButton(); //Construct the frame public wmo() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); jButton1.setText("jButton1"); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(400, 300)); this.setTitle("΢²¨Â¯"); contentPane.add(jButton1, BorderLayout.CENTER); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } }