 <p>One approach is to extend <a href="http://java.sun.com/javase/6/docs/api/javax/swing/JToggleButton.html" rel="nofollow noreferrer"><code>JToggleButton</code></a> and override <code>paintComponent()</code> to display the color. A <code>javax.swing.Timer</code> can control timing. Here is a somewhat more elaborate <a href="http://sites.google.com/site/drjohnbmatthews/buttons" rel="nofollow noreferrer">example</a>. </p> <pre><code>private static class SimonButton extends JToggleButton { private final Color color; Dimension size = new Dimension(100, 100); public SimonButton(Color color) { this.color = color; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); if (this.isSelected()) { g.setColor(color); } else { g.setColor(Color.lightGray); } g.fillRect(0, 0, this.getWidth(), this.getHeight()); } @Override public Dimension getPreferredSize() { return size; } } </code></pre>