hi, so i coded a projectile motion java applet, not only with this but with many other programs i get problems which seem to me to be a memory issue. But the first time lets say I shoot hte projectile it will not show the screen until it has landed and after that i lauch again it shows the projectile live as it should have shown the first time.

Before fired the first time: http://i.imgur.com/V4LnC.png

During flight: http://i.imgur.com/020nD.png

Landed: http://i.imgur.com/g7pJ1.png

Recommended Answers

All 5 Replies

It could be your GUI display. Can't really pin point anything unless I see some source code.

It could be your GUI display. Can't really pin point anything unless I see some source code.

Do you think code can actually cause this though?

"memory problems" in Java are pretty much limited to Java throwing an out of memory exception. If you don't have such an exception it's 99% certain you have a problem with your code.

since its an applet most likely its a problem with the gui? well i added an if statement in the gui that periodically checks for an intersection after that this occured.

Ok guys

repaint();

was the method missing in the snese i should have been calling it before the if statment, i guess thats just how paint() methods work i dunno really but htanks all!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.