basically this is my end of the year project. I do not have much knowledge in Java but I do have Perl and C++ programming background. I jumped right into this project started to test few things out and I am lost big time. The error message reads "illegal start of expression" and points to "public void paint". What am I doing wrong? [ edited to format code a bit and to preserve formatting using the [code] and [/code] UBB tags -ds ] [ April 14, 2004: Message edited by: Dirk Schreckmann ]
I just changed it. I guess I should've looked at that "naming policy"! After I saw the forum guidelines and rules and regulations, I didn't feel the need to look at it. hopefully someone can come up with an answer to my question.. I am digging through my books and constantly refreshing this post!! Also any suggestions on how to go about doing this applet will be appreciated(algorithms and useful native java packages).
posted 16 years ago
Welcome to object-oriented programming in Java. Without spending the time to learn to program in Java, you're likely to have a hard time programming in Java. Note that class is not a set of instructions that get sequentially executed when loaded into memory. Follows is a modified version of your applet that will compile, run and do something. But this isn't really an example of something well-designed. Perhaps it'll give you an idea for getting started.
With an applet, getting user input through the console probably isn't a good idea, especially as many applet users don't have their console enabled and displayed. Something like a text field would be more appropriate. Also, as in this ugly example, putting the program control logic in the paint method isn't a good idea. The paint method is for displaying something, not for controlling the flow of a program. Here is a list of free on-line tutorials and books that I have found useful for learning about programming in Java: