• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with very basic graphics program  RSS feed

 
Mitchell Neill
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm a first time poster so i'm not entirely sure how to phrase this, constructive criticism is welcomed

Basically I have to problems, the first is the when I scroll over the word "Checkerboad" in the line " public class Checkerboard extends GraphicsProgram {"
It gives me this message " The serializable class Checkerboard does not delcare a static final serialVersionUID field of type long"
The word also has a yellow underline...
Another problem is that when i try to run the program it says "Selection does not contain a main type (do you have a public void run() method?)"

I've pasted the program below:Please help
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mitchell Neill wrote:I've pasted the program below:

Hi Mitchell,

I'll leave the advice to others because I'm not a GUI expert, but please UseCodeTags (←click) when you post code. And please read the page thoroughly, because there are a few gotchas to know about (in particular, excessively long lines).

I've done it for you this time. See how much better it looks?

Thanks

Winston

[Edit] Oh, and BTW, welcome to JavaRanch.
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mitchell, I think we'll need to see the parent class, GraphicsProgram, to help you.
 
Mitchell Neill
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It references an acm pack I was told to download which contains definitions for grapichs programs and console programs. I tried going into the class file and I was able to copy and paste the text, so ill attach it as a picture.

Sorry I'm pretty bad at java so I wasn't sure if this is what you wanted

 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"acm pack"?

Well, that's Greek to me (which, from a guy who used to code in APL, ought not to be the admission of bafflement that it is).

That error message about "serializable class" strongly suggests to me that you are using something more complicated than you need. If you want to draw a checkerboard (a perfectly reasonable instructional problem), you don't need anything fancy. Grab a good book or Web page on Java graphics and you'll have all you need.

Now, I hate it when I ask a question and the answer I get is some variation on, "Why the Heck are you doing that? you should be doing this instead!" So, apologies if that's how my advice sounds. But you really don't need any "packs" or other downloads to draw a checkerboard. I suggest you set that aside for now and just go with what's in the standard Java API. The tutorials Oracle hosts are pretty good. Try this one.

Good luck!
 
Mitchell Neill
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all the help, I've been looking over the oracle tutorial and it seems really good (Far better then the acm pack) Thank you for you advice. In case you were curious as to where I got the notion of the acm pack, their was a free online java course thing from Stanford University which uses it. But to be honest I've found all their downloads a little buggy. (Good lectures though) At any rate thank you very much for the help
 
Stevens Miller
Bartender
Posts: 1445
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hang in there. It will all make perfect sense at around the same time the next great programming language comes along.
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The thing about UIDs for serialisable classes has to do with whether you are or are not serialising identical forms of the class. You will find a bit about it in this post, which has other references in.
The yellow bit means you have a warning from the IDE, so you are not obliged to change anything. Usually true “errors” are marked in red, and you do have to deal with them, or your code won’t compile.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!