package awtSample01;
public class mainClass {
public static void main(String[] args) {
// Application - > App
//
// Web 환경(front) -> java(back) <-> file(data)
// Html, JavaScript -> JQuery(Ajax) + CSS(디자인)
// DB(oracle, MySQL..)
// AWT, swing(AWT경량화) -> fx
//
// MVC 환경(= Spring)
//
// Abstract Window Toolkit
// AWT == swing == C# == Android(android studio)
//
//
new WindowTest();
// new WindowTest1();
// new WindowTestJ();
}
}
package awtSample01;
import java.awt.Frame;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class WindowTest extends Frame implements WindowListener{
public WindowTest() {
super("간단한 예제");
setSize(640, 480); // 윈도우의 크기 (폭, 높이)
setLocation(100, 0); // 윈도우 실행위치
setVisible(true); //윈도우 시각화
addWindowListener(this);
}
@Override
public void windowActivated(WindowEvent e) {
// TODO Auto-generated method stub
System.out.println("windowActivated");
}
@Override
public void windowClosed(WindowEvent e) {
System.out.println("windowClsed");
}
@Override
public void windowClosing(WindowEvent e) {
System.out.println("windowClosing");
System.exit(0);
}
@Override
public void windowDeactivated(WindowEvent e) {
System.out.println("windowDeactivated");
}
@Override
public void windowDeiconified(WindowEvent e) {
System.out.println("windowDeiconified");
}
@Override
public void windowIconified(WindowEvent e) {
System.out.println("windowIconified");
}
@Override
public void windowOpened(WindowEvent e) {
System.out.println("windowOpend");
}
}
기초 구현
'Java > java 기초' 카테고리의 다른 글
이클립스 (eclipse) 기준으로 awt의 글씨가 깨질때 (0) | 2019.12.05 |
---|---|
awt - label (0) | 2019.12.05 |
자바 디자인 패턴 - Observer Pattern (0) | 2019.12.04 |
자바 디자인 패턴 - Factory Pattern (0) | 2019.12.04 |
Calendar (0) | 2019.12.04 |