Re: question on multidimensional array
From: Huub (v.niekerk_at_freeler.nl)
Date: 05/31/04
- Next message: Jo Vermeulen: "adding a condition to the enhanced for loop"
- Previous message: Andrew Thompson: "Re: question on multidimensional array"
- In reply to: Andrew Thompson: "Re: question on multidimensional array"
- Next in thread: Oscar kind: "Re: question on multidimensional array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 May 2004 10:59:01 +0200
Andrew Thompson wrote:
> On Mon, 31 May 2004 09:10:38 +0200, Huub wrote:
>
>
>>>Short, Self contained, Complileable, Example.
>>>
>>>To Huub. My Newsreader lists posts
>>>by how many lines they are.
>>>
>>>I just noticed, skimming the group that someone
>>>posted a 173 line question, and one of the more
>>>experienced members of the group posted a single
>>>250 line reply.
>>>
>>>Neither of these posts is extraordinary.
>>>
>>>[ But the shorter the better.. ]
>
>
> ( hinting at shorter than 173 lines.. )
>
>
>>OK, here's the code (4 classes,
>
>
> The example only requires two. If you can
> pass a 2D arary between one class and another,
> you can do it between 6, 10 or 50..
>
>
>>..error is with the 1st and 2nd). I hope
>>I'm not trying to do something impossible.
>
>
> You are attempting to do something fairly
> easy (from your description) but the
> 'penny has not dropped' yet. You will
> kick yourself when it finally makes
> sense, you will _then_ wonder how you
> ever misunderstood it. ;-)
>
>
>>import javax.swing.*;
>
> ...
>
>> knoppen[9].addActionListener(
>
>
> OK. I am gonna break in here.
>
> Somebody else may wade through your code,
> but I do not have the time to wade through
> your 4 classes, spread over a 357 line post,
> especially when the source needs to be broken
> into separate files to compile, and includes
> other compile errors in addition to that..
>
> C:\Spel.java:19: ';' expected.
> de knoppen in te plaatsen
> ^
> C:\Spel.java:19: Duplicate variable declaration: de knoppen was JButton
> knoppen[]
> de knoppen in te plaatsen
> ^
> C:\Spel.java:22: ';' expected.
> het frame
> ^
> C:\Spel.java:31: ';' expected.
> voor het frame
> ^
> C:\Spel.java:39: ';' expected.
> en het menu
> ^
> C:\Spel.java:274: Public class Speelveld must be defined in a file called
> "Speelveld.java".
> public class Speelveld
> ^
> C:\Spel.java:308: Public class Speler must be defined in a file called
> "Speler.java".
> public class Speler
> ^
> C:\Spel.java:320: Public class Pion must be defined in a file called
> "Pion.java".
> public class Pion
> ^
> 8 errors
>
> ....
> Your SSCCE should be trimmed to under 100 lines.
>
> You can make the 'public' classes 'default' so
> that they compile in a single file.
>
> Please have a _careful_ read of the SSCCE document
> and you will note that you do not need a UI for this..
> Especially not an UI with 9(!) buttons.
>
> As I recall, I provided a self contained
> example earlier.. Yeah.. there it is..
> <http://groups.google.com/groups?th=7995d61159b0265c#link2>
> less than 40 lines of code that can be copy/pasted/compiled/run
> that demonstrate passing a 2D array between classes.
>
> Also check Woebegone's even shorter example,
> immediately below that post.
>
> It is important to understand how you can
> trim code down to the *simplest* code that
> demonstrates a problem or solution.
>
Alright. I'll have a thorough look at it once again. Then see if I
should make another post or reply. 8 Errors....I really got only 1. But
maybe this 1 holds back the others as yet.
Thanks so far.
- Next message: Jo Vermeulen: "adding a condition to the enhanced for loop"
- Previous message: Andrew Thompson: "Re: question on multidimensional array"
- In reply to: Andrew Thompson: "Re: question on multidimensional array"
- Next in thread: Oscar kind: "Re: question on multidimensional array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]