Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Nudge Btn

$
0
0
Hi i am new to java and trying to work out how to use a nudge btn on a fruit slot game i have created so far i have come up with this code:
 if (e.getSource()== btnnudge1 ){
        	   	timer1.start();
        		long start = System.currentTimeMillis();
        		timer1.start();
        		long end = start + 10*1000; 
        		while (System.currentTimeMillis() < end);
        		timer1.stop();
        			
        	    }

When the nudge button is pressed I want the the timer1 to run for 5 sec and stop but this code just freezes the whole program
any help?
Thanks!

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>