import java.awt.*; import java.applet.*; import - TopicsExpress



          

import java.awt.*; import java.applet.*; import java.awt.event.*; public class MovingBall extends Applet implements Runnable, ActionListener{ Thread t; int x=34,y=14; int dx=5,dy=5; Button button; String status = Go; boolean add = true; public void init(){ t = new Thread(this); t.start(); button =new Button(); add(button); button.addActionListener(this); } public void run(){ while(true){ if(status.equals(Stop)){ synchronized(t){ try{ t.wait(); }catch(Exception e1){ e1.printStackTrace(); } } } if (x+dx>this.getWidth()||x+dxthis.getHeight()||y+dy
Posted on: Fri, 12 Sep 2014 16:24:05 +0000

Trending Topics



Recently Viewed Topics




© 2015