a small loading problem...

Hi, I havent use vaadin in some time, so I dont remember why exactly this part of my code isnt working (bSer is a button):

private void detenerServicio(){
if (Service.isRunning()) {
bSer.setIcon(new ThemeResource(“…/icreativa/images/16/loader.gif”));
bSer.setCaption(“Stoping Service…”);
Service.stopService();
StopService stopService = new StopService();
stopService.start();
}
}

private void prosessed() {
getApplication().getMainWindow().showNotification(“Service has been stoped…”);
bSer.setIcon(new ThemeResource(“…/icreativa/images/16/play.png”));
bSer.setCaption(“Start Service”);
}

public class StopService extends Thread {

	StopService() {
		super();
	}

	@Override
	public void run() {
		try {
			while(Service.isRunning()){
				Thread.sleep(1000);
			}
		} catch (InterruptedException e) {
			//("Some error...");
			
		}
		// synchronize changes over application
		synchronized (getApplication()) {
			prosessed();
		}
	}

I have a similar code in an old proyect that is working, but in here is not, the button never is updated when I reach the procesed() method, I dont know what Im doing wrong or if I miss something… Th only thing diferent is that on the other project I send some actions to a vaadin window that contains a progress indicator, I need to add this?

Here is the code I have on the other project:

private void prosessed(boolean runned, String lastError) {
if (runned)
runWindow.setSuccess();
else
runWindow.setError();

}

public class RunBascula extends Thread {
	Bascula bascula;
	String lastError = "";
	boolean runned = false;

	RunBascula(Bascula bas) {
		this.bascula = bas;
	}

	@Override
	public void run() {
		try {
			Thread.sleep(1);

//Some actions…

		} catch (InterruptedException e) {
			Log.error("Scale","hubo un error al actualizar la bascula " + this.bascula.getIp() +"; causa:" + e.toString());
		}
		// synchronize changes over application
		synchronized (getApplication()) {
			prosessed(this.runned, this.lastError);
		}
	}

//Runwindow…

public class RunWindow extends Window {
	private ProgressIndicator pi1;
	private Label msg;