upThread.get(i).dx;}if(yNow>(getHeight()-23)||yNow<0){//碰到上下边界;groupThread.get(i).dy=-groupThread.get(i).dy;}groupThread.get(i).setxNow(xNow+groupThread.get(i).getdx());groupThread.get(i).setyNow(yNow+groupThread.get(i).getdy());}}if(isMouse){g.drawImage(newImageIcon("boll.gif").getImage(),mxNow,myNow,40,40,this);}}//endpaint();C:(1)publicvoidmousePressed(MouseEvente){//单击启动鼠标事件;if(e.getButton()==MouseEvent.BUTTON1){if(isMouseThread){//鼠标线程是否活着;mouse.stop();isMouseThread=false;}if(!isTime){copy.schedule(newtask(),0,1000);//启动定时器;isTime=true;}if(!isGroupThread){for(inti=0;i<n;++i){Threadmy=newThread(groupThread.get(i));my.start();//启动游戏,启动小球线程;}isGroupThread=true;}mxNow=e.getX();myNow=e.getY();isMouse=true;}//endif(e.getButton()==MouseEvent.BUTTON1);}(2)publicvoidmouseReleased(MouseEvente){