package applet;
import java.awt.*;
import java.awt.event.*;
//往窗口中添加Label,出现问题,请指出,谢谢!
public class Label {
static Frame fr=new Frame("This is a window!");
static Label lab=new Label();
public static void main(String args[]){
fr.setSize(200,170);
lab.setText("This is a label!");//有问题
lab.setAlignment(Label.CENTER);//有问题
fr.add(lab);//有问题
fr.setVisible(true);
fr.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
}
}