Derek wrote:
> What is the problem?.
Many things, A quick rundown of what I saw at first glance. There might
be more:
- No usage of a layout manager
- pack() without a layout manager in use
- Superfluous object caching (all this if(<some gui component> ==
null)), this comes together with no disposing of no longer used GUI
components
- Usage of one shared event handler only, instead of separate ones
(resulting in the need to discriminate via the event source with an
if/else orgies)
- At least one superfluous setVisible(true) call, which goes hand in
hand with showing the window in the constructor, which is usually a no-no.
- No revalidation when the layout is changed, alternative, no use of a
CardLayout
- Creation of the GUI outside of the EDT
- Messing with the default PLAF colors (that one is arguable)
Whatever tutorial or book you are using, may I suggest that you get a
better one? Even Sun's own UI tutorial (which isn't too great) would be
better.
/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/...g/java/gui/faq