帮帮忙 我是在想不出是哪错了?
import java.awt.*;import javax.swing.*;
import java.awt.event.*;
public class MyJFrame extends JFrame implements ActionListener
{
JButton cmdExit=null;
JPanel panel=null;
Container cPanel=null;
public MyJFrame(String strTitle)
{
this.setTitle(strTitle);
this.setAlwaysOnTop(true);
this.setSize(400,300);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
init();
}
public void init()
{
cPanel=this.getContentPane();
cmdExit=new JButton("关闭");
cmdExit.addActionListener(this);
panel=new JPanel();
panel.add(cmdExit);
cPanel.add(panel,BorderLayout.NORTH);
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==cmdExit)
{
this.dispose();
}
}
}
调试后 总是出现
-------------------配置: <默认>--------------------
E:\JAVA\text\lch\MyJFrame.java:14: cannot resolve symbol
symbol : method setAlwaysOnTop (boolean)
location: class MyJFrame
this.setAlwaysOnTop(true);
^
1 error