Re: Frustrated by AWT..need some help
JT wrote:
Mark Space wrote:
JT wrote:
Here's a piece of code that I borrowed from another site and made to
show my traffic light.
I respect what you are trying to do here; your on-going efforts to
learn Java are very admirable. However, that AWT code you posted
hurted my brain.
Mine too.
Seriously, the reason I picked AWT was that I thought my application was
simple and therefore would not require all the bells and whistles that
come with swing. However, I will do as you said and attempt to switch
over to Swing. But do I really have to use Netbeans? Can't I do it in
Eclipse? :-)
I'm not sure the cause for your frustration is AWT or Eclipse. I think
it may be your approach to studying Java. I like to learn by picking a
project, rather than by following a tutorial, but I do it a bit differently.
I work in tiny, tiny steps, each ending in a complete, working program
that I fully understand. I try to make the steps so small that each
involves only a few lines of code, and at most one new concept. Of
course, I may find a step is over-ambitious, but if so I just back off
to an even smaller step.
For example, when I was learning AWT, one of the first steps was
"display an empty frame". Then I worked up to putting a label in it.
Adding a button was another step. Then writing a message to standard
error when the button was pressed...
If things are going well, a step may take only a few minutes. However,
if I get into difficulties, the difficulty is always in making a very
small change in an existing, tested program that I already understand.
Generally, there is only one issue involved, so I know what I need to
read about.
When learning a language, I would not write half a dozen very similar
methods without having fully implemented and tested one of them. For the
traffic light problem, I would aim to have e.g. the red light fully
working, turning on and off, before paying any attention at all to
yellow or green. I also avoid copying code. I may read something to get
ideas, but I need to write it out myself to be sure I understand it.
My programming language learning method may not work for you, but since
yours is frustrating you, maybe you should give it a try?
Patricia