import java.awt.Frame;
import java.awt.Button;
public class TestBorderLayout{
public static void main(String args[]){
Frame f = new Frame("Border Layout");
Buttton bn = new Button("BN");
Buttton bs = new Button("BS");
Buttton bw = new Button("BW");
Buttton be = new Button("BE");
Buttton bc = new Button("BC");
f.add(bn,"North");
f.add(bs,"South");
f.add(bw,"West");
f.add(be,"East");
f.add(bc,"Center");
f.setSize(200,200);
f.setVisible(true);
}
}
报错:--------------------Configuration: <Default>--------------------
C:\ex\12\TestGridLayout.java:8: cannot find symbol
symbol : class Buttton
location: class TestGridLayout
Button b1 = new Buttton("b1");
^
C:\ex\12\TestGridLayout.java:9: cannot find symbol
symbol : class Buttton
location: class TestGridLayout
Button b2 = new Buttton("b2");
^
C:\ex\12\TestGridLayout.java:10: cannot find symbol
symbol : class Buttton
location: class TestGridLayout
Button b3 = new Buttton("b3");
^
C:\ex\12\TestGridLayout.java:11: cannot find symbol
symbol : class Buttton
location: class TestGridLayout
Button b4 = new Buttton("b4");
^
C:\ex\12\TestGridLayout.java:12: cannot find symbol
symbol : class Buttton
location: class TestGridLayout
Button b5 = new Buttton("b5");
^
C:\ex\12\TestGridLayout.java:13: cannot find symbol
symbol : class Buttton
location: class TestGridLayout
Button b6 = new Buttton("b6");
^
6 errors
Process completed.
------解决方案--------------------------------------------------------
Buttton统统改为Button
结贴
------解决方案--------------------------------------------------------
注意错误提示,从那里面就能找到错误在哪,还要特别注意大小写、字母顺序
------解决方案--------------------------------------------------------
buttton,这个太假了,,
------解决方案--------------------------------------------------------
Buttton
------解决方案--------------------------------------------------------
要继承JFrame类啊