Why does java event not work

Hi all,I am doubt about the java domino agent.Is there any bug?the event handler of

java.awt always does work in my code snippets.Here is an example of my codes,

//********************************************************

import lotus.domino.*;

import java.awt.*;

import java.awt.event.*;

public class JavaAgent extends AgentBase {

 Database db = null;

public void NotesMain() {



	try {

		Session session = getSession();

		AgentContext agentContext = session.getAgentContext();

		Database db = agentContext.getCurrentDatabase();

  NewWin nw = new NewWin("Database");



	} catch(Exception e) {

		e.printStackTrace();

	}

}	

}

class NewWin implements WindowListener{

public NewWin(String wName){

	Frame frame = new Frame(wName);

	frame.setLayout(new GridLayout(4,1));

Button btn = new Button("Close");

frame.add(btn);

frame.setBounds(500,500,400,200);

frame.setVisible(true);

}

public void windowActivated(WindowEvent e){}

public void windowClosed(WindowEvent e){}

public void windowOpened(WindowEvent e){}

public void windowClosing(WindowEvent e){

     System.exit(0);

}

}

//*********************************************************

The windowClosing event does not handled. Please help me !!

Thanks advanced.

  • jChou