#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Close app from taskbar event handler?


    Hi all,

    When you close using the x in a java application, there is a event handler function for this, but this event handler does not appear to be called when you choose close from the taskbar.

    Has anyone come across this?


    Paul

    ----------------------------------------------------------
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2009
    Posts
    19
    Rep Power
    0
    I'm not sure what event handler you used or what type of object you're using it on, but I tested this on my Vista machine and it calls the windowClosing method even when closing from taskbar.

    Code:
    myJFrame.addWindowListener(new WindowListener(){
    	public void windowActivated(WindowEvent e) {}
    	public void windowClosed(WindowEvent e) {}
    	public void windowClosing(WindowEvent e) {
    		// This will be called when the 'X' is pressed'
    		//    OR the window is closed from the taskbar
    	}
    	public void windowDeactivated(WindowEvent e) {}
    	public void windowDeiconified(WindowEvent e) {}
    	public void windowIconified(WindowEvent e) {}
    	public void windowOpened(WindowEvent e) {}
    });
    If that still doesn't work please give us more details such as your operating system, the type of object you're attempting to close from the taskbar (JDialog or JFrame?), and exactly what "event handlers" you've tried.

IMN logo majestic logo threadwatch logo seochat tools logo