JAVA/UI
label / 확인창 뜨게하기
웨이칭
2020. 6. 11. 16:37
public class mainClass {
public static void main(String[] args) {
new WindowTest();
}
}
public class WindowTest extends Frame implements WindowListener {
public WindowTest() {
super("Label");//=setTitle()
//setSize(640, 480);
//setLocation(0, 0);
setBounds(0, 0, 640, 480);//위의 두개와 동일
setVisible(true);
addWindowListener(this);
Label label = new Label();
label.setText("Label");
add(label);
Label label1 = new Label("label 입니다");//한글깨짐 수정함.
add(label1);
Label label2 = new Label("점심시간 5분전 입니다");//한글깨짐 수정함.
add(label2);
System.out.println("WindowTest WindowTest()");
// MessageBox
JOptionPane.showMessageDialog(null, "확인창 만들기");
}
@Override
public void windowActivated(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowClosed(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowClosing(WindowEvent e) {
// TODO Auto-generated method stub
System.exit(0);
}
@Override
public void windowDeactivated(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowDeiconified(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowIconified(WindowEvent e) {
// TODO Auto-generated method stub
}
@Override
public void windowOpened(WindowEvent e) {
// TODO Auto-generated method stub
}
}