[英]How do I know which method/class is called when I test java GUI in eclipse?
I am a beginner using eclipse for java programming. 我是使用eclipse进行Java编程的初学者。 Recently I downloaded certain source code online and ran it in eclipse successfully.
最近,我在线下载了某些源代码,并在eclipse中成功运行了它。 I want to learn how it runs.
我想学习它的运行方式。 However, I failed to find a way to monitor the progress during the program running.
但是,我找不到能在程序运行期间监视进度的方法。 For example, if I run the application and click certain button in the application GUI, how do I know which class/method is called?
例如,如果我运行该应用程序并单击应用程序GUI中的某些按钮,我如何知道调用了哪个类/方法? In other words, how can I use eclipse to monitor the process of program running?
换句话说,如何使用eclipse监视程序运行过程?
The general answer is to use the debugger. 一般的答案是使用调试器。 For example, set a breakpoint in some method and then use "Debug As" instead of "Run As" to run the application within Eclipse.
例如,以某种方法设置断点,然后使用“调试方式”代替“运行方式”在Eclipse中运行应用程序。
Here are a couple of tutorials / articles on using the Eclipse Debugger. 这是有关使用Eclipse Debugger的一些教程/文章。
在要调试的方法上放置一个断点(双击该行的左侧),然后调试程序。
只需将断点放在需要在Debug模式下查看和运行应用程序的代码行中,然后它将在您需要检查的相关代码行中等待。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.