tags:

views:

81

answers:

1

Is there an equivalent for Spy++ for java swing applications?

I work with a third party application that contains a huge number of screens that get invoked via a reflection based mechanism.

Whenever an issue occurs the only way to locate the problem code is to search through the source (we have access to the source but cannot fix and deploy due to contractual obligations) for a specific string sequence that occurs on the window in question. eg if I see the string "XYZ" on the buggy window I have to search against the source for that string to locate the java file in which the bug exists.

Is there a tool that will let me, at runtime, point to a Swing screen and return the class from which the screen is generated?

+2  A: 

Have you tried using Swing Explorer? It is more or less meant for similar tasks. I'm unaware of whether it will display the actual class that contains the component, but it certainly is capable of displaying the component hierarchy. You might want to check the ability to obtain the addition trace which contains the stack trace of the events leading to the component's addition to the tree.

Vineet Reynolds