I have programed a pong type game that extends a JApplet. In this JApplet i have a JFrame that is looping with this technique:

long start = System.currentTimeMillis();
while(System.currentTimeMillis()-start < 5)


when i run the program it will run with a good fps but the speed of the JFrame is super slow (not laggy, or choppy) although sometimes it speeds up and slows down about every second or two. Everything is in slow motion and not responding at 5 ms. I can fix this by opening up my graphics settings. In there i change a setting to something and then change it back and leave my graphics settings open. If i do this the game speeds up and runs fine... On other computers i am not always so lucky at finding something to open that will speed up the JFrame to the correct speed. In fact pretty much every time the game is slow when i try it on another computer. I have no idea what why this happens. It seems like it is a focusing issue maybe. When my ati graphics card EEE is open and stays open, everything runs perfect. I would like to not have this occur and if you need more code to solve this i will gladly put it up.