Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java IDE » Eclipse  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:Eclipse3.2中如何关闭frame窗口 [Re:helloyxw]
jeff_jian





发贴: 2
积分: 0
于 2008-02-25 12:56 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
给f添加个事件监听器,还有建议不要用show()方法,改用setVisible(boolean);
代码如下:

import java.awt.Color;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class tmp {

  /**
   * @param args
   */

  public static void main(String[] args) {
    Frame f = new Frame("yxw");
    f.setSize(600, 400);
    f.setLocation(100, 100);
    f.setBackground(Color.blue);
    f.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        System.exit(0);
      }
    });
    f.setVisible(true);
    // f.show();
  }

}




话题树型展开
人气 标题 作者 字数 发贴时间
18329 Eclipse3.2中如何关闭frame窗口 helloyxw 301 2008-02-20 01:22
15634 Re:Eclipse3.2中如何关闭frame窗口 jeff_jian 567 2008-02-25 12:56
14988 Re:Eclipse3.2中如何关闭frame窗口 Joffeec 33 2008-05-28 10:27
14510 Re:Eclipse3.2中如何关闭frame窗口 JiafanZhou 116 2008-05-30 17:36
15519 Re:Eclipse3.2中如何关闭frame窗口 Joffeec 199 2008-07-01 07:55
14815 Re:Eclipse3.2中如何关闭frame窗口 黑骏马 450 2008-06-28 10:14

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923