import java.awt.*;
class test extends Frame
{ public static void main(String[] args)
{
test t = new test();
Button bt = new Button("第一个");
t.add(bt);
t.pack();
t.show();
}
}
class test extends Frame
{ public static void main(String[] args)
{
test t = new test();
Button bt = new Button("第一个");
t.add(bt);
t.pack();
t.show();
}
}
因此,你必须产生一个实例(对象),然后才能引用。