我正在完成这个小任务,用一个字段和一个按钮创建一个gui。没什么难,但我不能运行该程序。 Eclipse一直告诉我在第18行调试当前指令指针“public static void main ..”
import java.awt.*;
import javax.swing.*;
public class Test extends JFrame implements ActionListener{
private JPanel panou;
private JButton schimba;
private JTextField field;
public Test(String _z) {
super(_z);
initComponents();
pack();
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] _args){
Test _frame = new Test("andreiterecoasa");
}
private void initComponents(){
setLayout(new FlowLayout());
panou = new JPanel(new FlowLayout());
schimba = new JButton("Schimba");
field = new JTextField(30);
panou.add(schimba);
panou.add(field);
add(panou);
schimba.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
String a = field.getText();
Cuvant z = new Cuvant(a);
field.setText(z.intoarce());
}
});
}
}
知道问题是什么?