My games does not work on Mac but works in Windows
See above. I just started using a Mac computer. I have no idea where to start.
We're gonna need a bit more to go on here...
What do you mean when you say it "does not work"? Does it not compile? If not, what errors do you get that you don't understand? If it does compile, then does it not run? If not, how does it crash? Does it run mostly correctly except some small things are different? If so, what's different? What were you expecting?
Are you using a cross platform game engine that you expect to run on both Apple and Windows computers?
We're gonna need a bit more to go on here...
What do you mean when you say it "does not work"? Does it not compile? If not, what errors do you get that you don't understand? If it does compile, then does it not run? If not, how does it crash? Does it run mostly correctly except some small things are different? If so, what's different? What were you expecting?
Are you using a cross platform game engine that you expect to run on both Apple and Windows computers?
As a test, it complies. The frame window appears but it is all blank- no rendering. No problems is listed in Eclipse. I wrote this Java game for Windows and figured it would run the game in Mac but apparently not. No cross platform engine was used. I wrote my own animation system using standard Java libraries to render everything in the game. The rendering/drawing methods were provided by Standard Java.
Solution:
Okay I figured out what was going on.
panel.add(this);
frame.setVisible(true);
If I flipped the order of these two code, the game won't appear in Mac. However, if I changed the order in Windows, the game will appear. Interesting finding!
Apparently I have to add the canvas to the panel before I allow the frame to presents itself.
Holy cow! So many down votes...