我在我的java类中实现了ActionListener,但是当我尝试自动导入(Shift+Alt+O)时,它给出了这个错误:
运行贡献的命令:“_vscode_delegate_cmd_ksicrwzq”失败。
整个代码在这里:
import javax.swing.JFrame;
import javax.swing.JTextField;
public class myframe extends JFrame implements ActionListener{
myframe(){
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLayout(new FlowLayout());
this.pack();
this.setVisible(true);
JTextField text = new JTextField();
text.setPreferredSize(new Dimension(250,40));
}
Run Code Online (Sandbox Code Playgroud)