标题:关于pocessWindowEvent(WindowEvent e)
只看楼主
llcy
Rank: 1
来 自:成都
等 级:新手上路
帖 子:16
专家分:0
注 册:2008-3-24
 问题点数:0 回复次数:0 
关于pocessWindowEvent(WindowEvent e)
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;

public class JFrame1 extends JFrame {
   
    /** Initialization method that will be called after the applet is loaded
     *  into the browser.
     */
    public JFrame1(){
        setSize(300,300);
        setTitle("try to use processwindowEvent");
    }
    public static void main(String[] args){
        JFrame1 jframe1 = new JFrame1();
        jframe1.setVisible(true);
    }
    protected void processWindowEvent(WindowEvent e){
        if(e.getID()== WindowEvent.WINDOW_CLOSING){
            System.exit(0);
        }
        else if(e.getID()== WindowEvent.WINDOW_ICONIFIED){
            this.setIconImage(new ImageIcon("middl.gif").getImage());
        }
        else if(e.getID()== WindowEvent.WINDOW_DEICONIFIED){
            this.setIconImage(null);
        }
    }

}
那位大哥,好心人帮我看一下`
为什么监听不到关闭事件啊` 怎么不能终止当前正在运行的 Java 虚拟机.点了关闭按钮没有反映啊.

[[it] 本帖最后由 llcy 于 2008-3-28 22:09 编辑 [/it]]
搜索更多相关主题的帖子: WindowEvent import java awt public 
2008-03-28 21:48



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-205917-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.224863 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved