Hi,
What is a the best way to organize files when programming a java GUI?
Sorry if this is a trivial question but I am rather new to programming
and would like some input from this group.
Right now, I have one large file with the frame, panels, widgets and
events. It's cumbersome to me. I think there is a better way to
separate these into individual files.
Does anyone have any quick and easy rules of thumb for organizing a
large window programmed in Java Swing?
Thanks,
RM
Roedy Green - 25 May 2004 17:57 GMT
>Does anyone have any quick and easy rules of thumb for organizing a
>large window programmed in Java Swing?
Organise it by panels. Each panel extends JPanel and is a separate
class.
This tends to make hunks of it reusable.
e.g. a date selecting panel.

Signature
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
SZDev - Slash - 29 May 2004 18:12 GMT
> Hi,
>
[quoted text clipped - 9 lines]
> Does anyone have any quick and easy rules of thumb for organizing a
> large window programmed in Java Swing?
Make each panel a separate class and don't put components others than panels
in the JFrame, if possible encapsulate the functionality of them.
Don't use THIS for event listeners, make event listeners in separate classes
to allow reuse and registry on different components.
> Thanks,
> RM
SZDev . Slash