±Û¾´ÀÌ :ÇØ È¿. 1998³â 6¿ù 17ÀÏ 10:51:45
¾È³çÇϼ¼¿ä. °æ±¸´Ô.
¾Æ·¡´Â °æ±¸´Ô²²¼ ÁֽŠ½î¾² ÄÚµåÀÔ´Ï´Ù.
ÇÁ·¹ÀÓâÀÌ Çϳª¶ß°í ±× ÇÁ·¹ÀÓ Ã¢ ³»ÀÇ ¹öÆ°À»
´·¶À»¶§¿Í ¸Ç ¿ÞÂÊ À§ x ¸¦ ´·¶À»¶§ ÇÁ·¹ÀÓÀÌ
´ÝÈ÷´Â ÄÚµåÀε¥, Á¦°¡ ³×Æ®..4.05 ¿¡¼ Çغ¸°í,
ÀͽºÇ÷η¯ 4.0¿¡¼ Çغ¸¾Ò´Âµ¥,
µÑ´Ù ÇÁ·¹ÀÓ Ã¢ÀÌ ¾È¶ß°í ¿¡·¯°¡ ³ª´õ±º¿ä.
¿¡·¯¸Þ½ÃÁö´Â NoSuchMethodError:java.awt.Button..
ÀÔ´Ï´Ù.
À½. ÄÄÆÄÀ϶§´Â ¿¡·¯°¡ ¾ø¾ú´Âµ¥....
´äº¯ ±â´Ù¸®ÁÒ....ÁÁÀº ÇÏ·ç...
import java.awt.*;
import java.awt.event.*;
public class Gui6 extends java.applet.Applet {
Frame window;
public void init() {
window = new MyFrame("A PopUp Window");
window.setSize(400, 300);
window.setVisible(true);
}
}
class MyFrame extends Frame
implements ActionListener {
MyFrame(String title) {
super(title);
Panel p = new Panel();
p.setLayout(new FlowLayout());
Button button= new Button("cancel");
button.addActionListener(this);
p.add(button);
add(p, "South");
p.add(new Label("This is a Window",Label.CENTER));
addWindowListener(
new WindowAdapter() { // anonymous local class
public void windowClosing(WindowEvent we) {
setVisible(false);
dispose();
}
}
);
}
// button action handler
public void actionPerformed(ActionEvent action) {
Object source=action.getSource();
if (source instanceof Button
&& action.getActionCommand().equals("cancel"))
{
setVisible(false);
dispose();
}
}
}