final PButton changeColorsBUtton = new PButton("Start");
changeColorsBUtton.addClickHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
final PTerminalScheduledCommand deferred1 = new PTerminalScheduledCommand() {
@Override
protected void run() {
changeColorsBUtton.setStyleProperty("color", "blue");
}
};
deferred1.schedule(2000);
final PTerminalScheduledCommand deferred2 = new PTerminalScheduledCommand() {
@Override
protected void run() {
changeColorsBUtton.setStyleProperty("color", "orange");
}
};
deferred2.schedule(4000);
final PTerminalScheduledCommand deferred3 = new PTerminalScheduledCommand() {
@Override
protected void run() {
changeColorsBUtton.setStyleProperty("color", "black");
}
};
deferred3.schedule(6000);
}
});
panel.add(changeColorsBUtton);
labelScheduler = new PLabel("0");