package extend;
import java.awt.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowAdapter;
public class BorderLayout {
private Button b1,b2,b3,b4,b5;
private Frame f;
public BorderLayout(){
b1=new Button("上北");
b2=new Button("下南");
b3=new Button("左西");
b4=new Button("右东");
b5=new Button("中间");
}
public void main(String argsp[]){
BorderLayout f=new BorderLayout();
f.show();
}
public void show(){
f=new Frame("BorderLayout布局演示");
/* f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent evt){
f.setVisible(false);
f.dispose();
System.exit(0);
}
});*/
f.setSize(400,300);
f.setLayout( new BorderLayout());
提示报错
The method setLayout(LayoutManager) in the type Container is not applicable for the arguments (BorderLayout)
何解??
------解决方案--------------------