Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse & Java: Is there an event monitoring feature?

When developing java guis (e.g. swing) in eclipse, is there a built-in feature (or plugin) that allows one to monitor all the events that are fired?

like image 944
opike Avatar asked May 30 '11 17:05

opike


1 Answers

You can also write an AWTEventListener on your own. Just add the following lines to your program.

Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
    public void eventDispatched(AWTEvent event) {
        System.out.println(event);
    }
}, -1);

Replace the output with anything you like. You can also listen to particular events only by changing -1 to some constants from AWTEvent.

like image 144
Howard Avatar answered Nov 15 '22 11:11

Howard