±Û¾´ÀÌ :ÇØÈ¿ 1998³â 6¿ù 12ÀÏ 10:34:00
¾È³çÇϼ¼¿ä.
Àú´Â Áö±Ý ÇÁ·¹ÀÓ Ã¢À» Çϳª¶Ù¿ì°í ³ª¼,
¹öÆ°À» ´·¶À»¶§¿Í ÇÁ·¹ÀÓâÀÇ ¸Ç ¿À¸¥ÂÊ¿¡
ÀÖ´Â x ¸¦ ´·¶À»¶§ À̺¥Æ®°¡ ¹ß»ýÇÒ¼ö ÀÖµµ·Ï
ÇÁ·Î±×·¥ ÇÏ°í Àִµ¥ ÇÁ·¹ÀÓâÀº ¶ß´Âµ¥,
ÇÁ·Î±×·¥ÀÌ Á¾·áµÇ´Â À̺¥Æ®´Â ÀÛµ¿À» ÇÏÁö ¾Ê´Â±º¿ä.
¹öÆ°À» ´·¶À»¶§¿Í ÇÁ·¹ÀÓâÀÇ ¸Ç ¿À¸¥ÂÊ¿¡
ÀÖ´Â x ¸¦ ´·¶À»¶§ ÇÁ·Î±×·¥ÀÌ Á¾·áµÇµµ·Ï
Çߴµ¥, ÀÛµ¿ÀÌ ¾ÈµÇ´Â±º¿ä...
¾Æ·¡½î¾²¸¦ º¸½Ã°í ´äº¯ÁÖ¼¼¿ä.
°¨»çÇÕ´Ï´Ù ÁÁÀºÇÏ·ç.......
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
public class Gui2 extends java.applet.Applet {
Frame window;
public void init() {
window = new MyFrame("A PopUp Window");
window.resize(400, 300);
window.show();
}
class MyFrame extends Frame {
MyFrame(String title) {
super(title);
Panel p = new Panel();
p.setLayout(new FlowLayout());
p.add(new Button("cancel"));
add("South", p);
p.add(new Label("This is a Window",Label.CENTER));
}
}
public boolean handlevent(Event e) {
if(e.id == Event.WINDOW_DESTROY)
System.exit(0);
return super.handleEvent(e);
}
public boolean action(Event evt, Object arg) {
if(arg.equals("cancel"))
System.exit(0);
else return false;
return true;
}
}