开发者

Eclipse & Java: Is there an event monitoring feature?

开发者 https://www.devze.com 2023-03-09 13:41 出处:网络
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 fir开发者_开发问答ed?You can also write an AWTEventListene

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 fir开发者_开发问答ed?


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.


There is something in eclipse, im not sure if this is exactly what your looking for. its called a "Watch" it watch for anything that happens with that particular variable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号