listensocket.java~1~
上传用户:lybcsm
上传日期:2007-04-26
资源大小:26k
文件大小:1k
- package ftpserver;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- public class listensocket extends JFrame {
- JPanel contentPane;
- BorderLayout borderLayout1 = new BorderLayout();
- //Construct the frame
- public listensocket() {
- enableEvents(AWTEvent.WINDOW_EVENT_MASK);
- try {
- jbInit();
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
- //Component initialization
- private void jbInit() throws Exception {
- contentPane = (JPanel) this.getContentPane();
- contentPane.setLayout(borderLayout1);
- this.setSize(new Dimension(400, 300));
- this.setTitle("Frame Title");
- }
- //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);
- }
- }
- }