buttonBar.add(new Button("Progress", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
final MessageBox box = MessageBox.progress("Please wait", "Loading items...",
"Initializing...");
final ProgressBar bar = box.getProgressBar();
final Timer t = new Timer() {
float i;
@Override
public void run() {
bar.updateProgress(i / 100, (int) i + "% Complete");
i += 5;
if (i > 105) {
cancel();
box.close();
Info.display("Message", "Items were loaded", "");