Hi,
Iam opening one dialog by using button press listener and it is taking some time, so i set one Activity Indicator in the mean time. I use the following code to set Activity Indicator.

private ButtonPressListener openListener = new ButtonPressListener() {
@Override
public void buttonPressed(Button arg0) {
activityIndicator.setActive(true);
setEnabled(false);
SampleTask sampleTask = new SampleTask();
TaskListener<Void> taskListener = new TaskListener<Void>() {
@Override
public void taskExecuted(Task<Void> task) {
task.getResult();
activityIndicator.setActive(false);
setEnabled(true);
}

@Override
public void executeFailed(Task<Void> task) {
activityIndicator.setActive(false);
progress.setVisible(false);
setEnabled(true);
}
};
sampleTask.execute(new TaskAdapter<Void>(taskListener));

}
});

public class SampleTask extends Task<Void> {
@Override
public Void execute() throws TaskExecutionException {
try {
BXMLSerializer serializer = new BXMLSerializer();
Dialog d = (Dialog) serializer.readObject(
SampleC.class, SCREEN_URL);
d.open(SampleC.this.getWindow();
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
}

Here iam getting an exception as:
java.lang.IllegalStateException: this method can only be called from the AWT event dispatch thread, and not from "Thread-23"

I think opening a dialog like above is not valid. So can you please suggest me where to write this block of code to open a dialog in setting Activity Indicator.

--
Thanks & Regards
B.S.V.S.Pavan Raju.
Skype: skype_pavan1
Hyderabad.