构造函数Object(String)未定义;对于eventHandling类型,方法setLayout是未定义的?

时间:2014-09-05 17:00:25

标签: user-interface methods

import java.awt.*;      
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JOptionPane;                 


     public class EventHandling {

private JTextField paco;
private JTextField paco2;
private JTextField paco3;
private JPasswordField passwordField;

     public EventHandling(String s, String set ) {

            super("title");                             

            setLayout(new FlowLayout());


    }

}

所以我在“super(”title“)中得到了这个错误;” - 构造函数Object(String)未定义, 然后为“setLayout(new FlowLayout());” - 方法setLayout(FlowLayout)未定义类型EventHandling

1 个答案:

答案 0 :(得分:0)

public class EventHandling extends JFrame {

...