简体   繁体   中英

Debugging Swing GUI with Eclipse

Is it normal that whenever I debug a Java application that has a swing gui using Eclipse it fails to debug properly whenever it reaches a line that has something to do with swing.

Heres an example:

int number = 0; //Debugs fine
textbox.setText(Integer.toString(number)); //Takes me to this window saying "Source not Found"

Below is an image detailing what comes up when the debugger reaches a line that has something to do with the swing GUI:

错误信息

  1. Make sure you have a JDK installed; there should be a file src.zip in the root folder of your Java installation. Without that, Eclipse can't find the sources.

  2. Make sure Eclipse picks up the sources. There must a tiny overlay over the JARs in the JRE definition dialog for the first 5 entries or so. The more important one is rt.jar

在此处输入图片说明

There may be chance that you have put the your debug Break Point on source class too. i would like you to follow the following suggestion.

  • Go to window
  • go to souce view
  • choose break point from there
  • once it is opened then click on double close icon on top of break point. then all break point are flush try new break point for debugging

i hope this will work for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM