fubarable

Untitled

Jul 1st, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. myButton.addActionListener(e -> {
  2.     Card[] cards = selectThree();
  3.     highlightBorders(cards, Color.RED);
  4.     int delay = 1000;  //  timer delay in msec
  5.     // create a Swing Timer
  6.     javax.swing.Timer timer = new javax.swing.Timer(delay, evt -> {
  7.         // action we want the timer to perform
  8.         highlightBorders(cards, Color.WHITE);
  9.     });
  10.     timer.setRepeats(false);  // it performs its action only once
  11.     timer.start();   // start up the timer
  12. });
Add Comment
Please, Sign In to add comment