日期:2014-05-20  浏览次数:20588 次

myeclipse无法进行图形界面编程
运行图形界面程序,没有反应。。程序应该没有什么问题
Java code

package com.test1;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;

public class MyServer3 extends JFrame{
    JTextArea jta=null;
    JTextField jtf=null;
    JButton jb=null;
    JScrollPane jsp=null;
    
    JPanel jp1=null;
    

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

    }
    public MyServer3(){
        jta=new JTextArea();
        jsp=new JScrollPane(jta);
        jtf=new JTextField(20);
        jb=new JButton("发送");
        jp1=new JPanel();
        jp1.add(jtf);
        jp1.add(jb);
        
        this.add(jsp,"Center");
        this.add(jp1,"South");
        this.setSize(400,300);
        this.setVisible(true);
        
    }

}




------解决方案--------------------
main函数没有写。