Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2004

Tip: Looking for answers? Try searching our database.

Debugging Swing Code

Thread view: 
Daniel Schneller - 24 Feb 2004 08:40 GMT
Hi!

I am currently trying to debug an existing swing application. What I am
basically looking for is some sort of tool or method to find out, how
panels are stacked.
For example I have a JFrame that is filled with a large number of
individual containers that all have different layouts, opacity settings
etc. It is very difficult to determine which components cover others,
because they are opaque while others aren't, in turn leading to unwanted
colors "shining through" from behind.

Debugging with Eclipse's debugger is not practical, because the GUI does
of course not get redrawn if I step through the code.
Is there a general solution to this problem?

Thanks,
Daniel
Thomas Weidenfeller - 24 Feb 2004 08:59 GMT
 > Debugging with Eclipse's debugger is not practical, because the GUI
does
> of course not get redrawn if I step through the code.
> Is there a general solution to this problem?

I would write a small static method which walks the component hierarchy
and prints out the necessary information. Alternatively, if you have a
scriptable debugger, you can do all the printing in the debugger (I am
not aware of any scriptable debugger, but haven't looked lately).

Oh, and I would have a serious word with the original author of the
code, for following the ill advice of heavily nesting components. Maybe
you are better off re-implementing the GUI from scratch?

/Thomas
Daniel Schneller - 24 Feb 2004 12:34 GMT
> I would write a small static method which walks the component hierarchy
> and prints out the necessary information.
Right. I will try that. I figured it out for this one case at hand
manually, but this still is not satisfactory. As soon as I find some
time I will look further into it.

> Oh, and I would have a serious word with the original author of the
> code, for following the ill advice of heavily nesting components. Maybe
> you are better off re-implementing the GUI from scratch?
Hehe :) I would agree with you were I not at least in a way the author
of that code. We are using a framework here that incorporates a GUI
designer that I used to create the GUI. Normally I would not use such a
tool for most tasks, but it has some features to tie the UI elements to
business logic and generates code for that, too.

But anyway it would be somewhat helpful to be able to visually grasp the
stacking structure in order to simplify the design in a refactoring cycle.

Thanks,
Daniel
ak - 24 Feb 2004 12:01 GMT
> I am currently trying to debug an existing swing application. What I am
> basically looking for is some sort of tool or method to find out, how
> panels are stacked.
take a look at JGoodies.com and forget panels stacking.

____________

http://reader.imagero.com the best java image reader.
Daniel Schneller - 24 Feb 2004 12:36 GMT
> take a look at JGoodies.com and forget panels stacking.
*sigh*

Would love to, but cannot do so without changing a whole business
application framework which is not really what I had in mind :) (and
which is not mine anyways).

Daniel


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.