I need a different approach - suggestions please

L

Lew

Not all Graphics objects are created equal in that regard. Some are
associated with GUI things, e.g. the one you get calling getGraphics on
a JComponent. Some are not, e.g. if you get one to draw on a BufferedImage.

And this useful nuance is good when one is ready to delve into the
fine points.

There are GUI calls that are thread-safe, or so the Javadocs claim. It is
relatively harmless as a rule of thumb, however, to assume none are
until one is confident of the difference. Much as I buy my mushrooms
in the grocery store, otherwise I assume all I find are toxic absent greater
expertise than mine.

Furthermore, drawing on a BufferedImage is a graphical action, but not
/per se/ a GUI one. Transferring that BufferedImage to a JComponent is
a GUI action.
 
G

Gene Wirchenko

[snip]
I'm going back to the base article, to suggest a basically different
approach.

During my spare time over the last couple of weeks I've been studying an
unfamiliar C++ graphics library. I realized that my normal approach to
learning languages and libraries was entirely different from yours.

I wrote a series of very simple, small programs, each of which
introduced only one new technique. For example, my program for learning
to connect a button to the code that should run when it is clicked
created a window containing one button, and wrote "hello" to standard
out each time it was clicked. When that was working I advanced to two
buttons doing different things.

Each learning program incorporated at most one new technique. The
programs I was really trying to write did not use any new graphics
techniques - I had tried everything out in smaller programs.

Have you considered a step-by-step approach, as an alternative to
writing an application and then trying to make it work?

I thought that I had mentioned that approach in this thread, but
no. I use the same approach as you when learning languages. For
general computing, I code a times table. First, I code the simplest
thing that I can to get it going. Then, I make adjustments in
whatever ways help me learn. Typically, the first version will not
have the columns line up, and that is the first change. I might have
to do something special to get right justification. I sometimes add
input for what range the table is to be for or for what operator. And
the list can go on. After that, a real-use program is much easier to
do.

Sincerely,

Gene Wirchenko
 
B

bilsch

...

I'm going back to the base article, to suggest a basically different
approach.

During my spare time over the last couple of weeks I've been studying an
unfamiliar C++ graphics library. I realized that my normal approach to
learning languages and libraries was entirely different from yours.

I wrote a series of very simple, small programs, each of which
introduced only one new technique. For example, my program for learning
to connect a button to the code that should run when it is clicked
created a window containing one button, and wrote "hello" to standard
out each time it was clicked. When that was working I advanced to two
buttons doing different things.

Each learning program incorporated at most one new technique. The
programs I was really trying to write did not use any new graphics
techniques - I had tried everything out in smaller programs.

Have you considered a step-by-step approach, as an alternative to
writing an application and then trying to make it work?

Patricia

Yes, I do generally use a stepwise approach. I appreciate the value of
that.
 
G

Gene Wirchenko

So what? If this religion is something that enough people agree on,
enough people have some sort of common baseline that aids their
communication.

Yup. Unfortunately, this common baseline of communication is
sometimes "Death to the heretics!" or a variation thereof. This
baseline of communication also all too often appears to sabotage
communication with others not of that ilk.
"Go to hell"
"Thank you Sir, could you tell me which bus line I need to take to get
there?"

I just checked Greyhound, and they do not appear to go there.
(Hell, MI, that is.)

Sincerely,

Gene Wirchenko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,843
Latest member
WizcraftEntertainmentAgen

Latest Threads

Top