import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
+import java.util.*;
/**
* Moosique's graphical user interface.
private MooToolbar toolbar;
private MooView view;
private JLabel statusBar;
+ private java.util.Timer timer;
+ public static final int statusResetDelay = 3000;
public static final Font FONT = new Font("Helvetica", Font.PLAIN, 10);
public static final Color bgColor = new Color(192, 224, 255);
statusBar.setBackground(bgColor);
view.setBackground(bgColor);
+ // Creates timer.
+ timer = new java.util.Timer();
+
// Sets up global key listener
ActionMap am = getRootPane().getActionMap();
*/
public void setStatus(String text) {
statusBar.setText(text);
+ timer.schedule(new StatusResetTask(), statusResetDelay);
}
/**
Moosique.quit();
}
}
+
+ class StatusResetTask extends TimerTask {
+ public void run() {
+ setStatus(" ");
+ }
+ }
}