I would like every menuItem to be a object and to have it's own paint method and so on. The problem is that i don't know how to do the loop and to paint the whole menu .... by the way... the menu I looking for is something like the one used here. I developed the site myself but I can't figure out how to make the menu in more than one step. [ April 15, 2004: Message edited by: Mathias Nilsson ]
If you declare a class "abstract" then it cannot be instantiated. That is you can't make an instance of it. The diffrence between an abstract class and a interface is that an abstract class can have none abstract methods. If you should make a abstract class of a man,woman,boy,etc then you should try to locate something that they all have incommon. Ears, Eyes, head, neck, body, and so on. In an abstract class you can return values in a method
if you had a abstract method in the abstract class then you would force the Girl class to include the method.
Here you would have a compile error because the Girl class didn't include the getName method. It's up to the Girl class to supply the implementation of the getName() method. Hope this make sence. There are probably experienced java programmers that would explain this more clearly. // Mathias
When you have pressed the link and the other window opens
Hello! I have a question on the graphics object! I'm trying to make my first java game and just wonder. Do I have to use the same graphics object that is passed to the paint() method in the applet? If I use another graphicsobject in another class then It doesn't paint anything on the applet. It's just that it is very annoying to pass the Graphics object to every other method. Is there anybody who can tip me on what is good programming? I want to have a paint method in another class so that the class can handle it's own painting. // Mathias
Hi all! I'm having a hard time getting my falling block applet game to work. First of all I have to compile my java files using -target 1.1. When I use a class I've made to handle the squares in my game I get an error. It seams that I can't use ArrayList? Does anyone have a solution to this problem? Here is my Grid class. Why can't I use this in a applet.
Applet error: error: java.lang.NoClassFoundDefError : java/util/ArrayList When I dont use the Grid class in my Applet it works fine. [ April 14, 2004: Message edited by: Mathias Nilsson ]