I have programmed a Java Swing application. I have some bugs in my program and I want to discover where in the code these errors occurs.

With normal code (Non-GUI related code) I apply debugging for such type of wishes.

My question is how to debug or profiling (or any other technique that will help me) a Swing application in order to discover where in the code an user action occurs? (Ideally also show where the error occurs, but showing which code is executed for which user action in the GUI is enough also)

I am using netbeans, but other software is also go (as long as it is free).


The first step is to have to find where is the code related to the UI you are interacting. Try to get some text description from the UI and find within your code. Once you found it´s time to create breakpoints and triggers the actions on the UI.

Take a look on Binary Debugging Technique and some other tips on how to debug a code.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.