Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > I need a different approach - suggestions please

Reply
Thread Tools

I need a different approach - suggestions please

 
 
Lew
Guest
Posts: n/a
 
      06-28-2012
On Wednesday, June 27, 2012 7:23:02 PM UTC-7, B1ll G4tes wrote:
> On 27/06/2012 9:54 PM, Lew wrote:
> > GUI actions are all things that happen on the GUI, such as creating
> > a 'JFrame', calling 'pack()', playing with 'Graphics', or anything else that
> > is part of the GUI.

>
> 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.

--
Lew
 
Reply With Quote
 
 
 
 
markspace
Guest
Posts: n/a
 
      06-28-2012
On 6/28/2012 9:51 AM, Joshua Cranmer wrote:
> On 6/28/2012 10:33 AM, markspace wrote:
>> On 6/28/2012 4:55 AM, Mike Winter wrote:
>>> to have addressed yet. See <news_sGr.321702$(E-Mail Removed)4>
>>> posted yesterday (27th) at 01:04 GMT.

>>
>>
>> That link is completely mangled for me.

>
> Thunderbird doesn't properly support news URIs that don't specify a
> server.



No, it doesn't. I'll bike over to their office and yell at them.




 
Reply With Quote
 
 
 
 
Gene Wirchenko
Guest
Posts: n/a
 
      06-29-2012
On Fri, 29 Jun 2012 08:12:24 -0700, Patricia Shanahan <(E-Mail Removed)>
wrote:

[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
 
Reply With Quote
 
bilsch
Guest
Posts: n/a
 
      06-29-2012
On 6/29/2012 8:12 AM, Patricia Shanahan wrote:
> On 6/25/2012 3:31 PM, bilsch wrote:
>> I'm trying to make a program that works like the calculator in Windows
>> Accessories - all input is from button clicks. Below I listed a
>> stripped down version of the GUI and a little of the processing behind
>> it. It is in two small files. I had intended that the program would
>> display a sequence of digits from button clicks, which I would then
>> convert into a Double precision number. The problem is I am constrained
>> to initialize the string within the method that accumulates the sequence
>> of digits. Everytime the method is called the string is reinitialized
>> with the result that my sequence of digits is only ever one digit long.
>> My plan would work if I could initialize the string outside the method,
>> however variable scope in Java doesn't allow it.

> ...
>
> 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.
 
Reply With Quote
 
Gene Wirchenko
Guest
Posts: n/a
 
      07-02-2012
On Mon, 2 Jul 2012 11:32:34 +0200, Wanja Gayk <(E-Mail Removed)>
wrote:

>In article <jsdsub$or8$(E-Mail Removed)>, http://www.velocityreviews.com/forums/(E-Mail Removed)d
>says...
>
>> >>> It is best to use the Java Coding Conventions or something very close.

>
>> >> That is your religion.

>
>> > Facts not religion.

>>
>> State-sponsored religion is still religion

>
>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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best approach to use different datasources - ? alexandis@gmail.com ASP .Net 10 11-06-2007 03:31 PM
Suggestions for how to approach this problem? John Salerno Python 13 05-10-2007 06:26 PM
MenuItems point to two different forms, what is best approach kbutterly ASP .Net 2 01-18-2007 01:03 PM
BC30466: Namespace or type cannot be found - different approach! sorCrer ASP .Net 1 01-19-2005 03:22 PM
Encrypt String or different approach Gary Townsend (Spatial Mapping Ltd.) ASP .Net 4 11-09-2004 11:36 PM



Advertisments