问题
We are working on a Java program with a GUI and we are looking for a tool that shows us which parts of code are executed as we click on the buttons in the GUI. Any suggestions ? Thanks in advance
回答1:
Eclipse with debug mode can do that, you just need to put break points in your listeners and click on the buttons.
It works out of the box with eclipse... a simple run Debug and it's done.
回答2:
The simplest approach is to use print statements. If you require more sophistication, either use an IDE (e.g. Eclipse, NetBeans, and etc.) in debug mode, or some logging mechanism (e.g. log4j).
回答3:
Personally, I use BlueJ debugger:
http://www.stfrank.com/debug-21.png
回答4:
I use Swing Explorer
来源:https://stackoverflow.com/questions/7903314/stepping-through-the-gui-in-java