帮助改一下程序
import java.awt.*;
import java.awt.event.*;
public class Interact implements ActionListener {
Frame f=new Frame("按钮交互事件");
f.setLayout(new FlowLayout());//此处出现提示错误。
Button b=new Button("打开");
public void actionPerformed(ActionEvent e)
{ if(e.getSource()==b)
{ if(b.getLabel()=="打开")
{ b.setLabel("关闭");
f.pack();
}
else
{b.setLabel("打开"); f.pack();}
}
我想作一个按钮交互的图像,看看上面的程序怎么改呀。
}
}