i am making a scrolling text applet...i have implemented 1 thread ..now on mouse over of text i want to stop scroll which i am able to do now the momemt i exit text scrolling should start again which not happening.
in run() method i hve put a boolean "stopflag" variable which stops the execution or loop and scrolling stops...here goes the code:
public void run() {
addMouseMotionListener(this);
addMouseListener(this);
for(;{
try {
repaint();
Thread.sleep(20);
if (xaxis<msglen){
xaxis=640;
}
xaxis=xaxis-2;
if (stopflag)
break;
}
catch(InterruptedException e){}
}
}
now how to re run the this method again.


{
Reply With Quote
Bookmarks