• Post Reply Bookmark Topic Watch Topic
  • New Topic

Debuggin Swing application  RSS feed

 
divs saran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm trying to debug a huge swing application(developed some years ago). The problem I have is I have to walk through multiple files before I can get to the file I want. Is there tool/way to find the exact file I want to debug?

Thanks,
Divs.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure I understand. Do you already know which file you want to debug? If not, how would a tool know which one? Could you maybe provide a bit more details about the problem? Why do you have to step through several files, etc?
 
divs saran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg, Thanks for going thru my question. I do not know what file I want to debug. I'm new to swing applications. for example, to debug web applications, I view source to find servlet name and search that particular file in RAD to set break-points n debug. How do we find the file name associated with a particular screen in Swing applications? Is there a way? or do I have to go through all the java files.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh, now we are getting somewhere. And yes, I can see how that would be a problem. What I'd hope for is a package structure and naming convention that made sense. So if I had a login form I might have a class file called LoginForm or LoginSomething at least. So my first thing would be to look at the window titles or form descriptions and try and find similarly named classes.

As far as packages I tend to place all my forms under a form package name so maybe look at the packages and see if they make any sense. You could also try looking at the labels on the windows/forms and search for similar named variables to find the class.

Beyond that, if the original developers stunk enough to use odd named classes (I've seen classed named BFH348.java and variables named label2, ) then I don't know what to tell you. Stepping through from a starting point and locating things may be your only option.
 
divs saran
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gregg, I appreciate your detailed reply.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
(I've seen classed named BFH348.java and variables named label2, )


And I thought I was the one who had the biggest mess to sort. My current project contains Document1.java, Document2.java....Documentn.java. Obviously I could infer the original developer was using text pad. Were the BFHxxx sequential and incremental? (At least you can figure out which class preceeds which class)
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They were in some tax/accounting software and they were acronyms for form titles. Although the forms themselves didn't have names. So it was still pretty difficult. I guess it would be like having a class named 1099.java but not having a title on the actual form that told you this.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Currently I am working on a swing UI which uses lots of customized components. I played around and came up with the following:

1) Extended a panel and set it as the glass pane.
2) Installed mouse listener to the glass pane and trapped mouse clicks
3) On mouse click I invoked the following code:


It shows me the base containers along with the fully qualified class name in the dialog.
Needless to say this will require further tweaking , but this approach is definitely better than reading and tracing through the code.

Hope this helps.
[ January 10, 2008: Message edited by: Maneesh Godbole ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!