Display time in red when 10 seconds or less is left

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@167 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Matthias Schiffer 2011-05-06 03:56:23 +02:00
parent b8206243a7
commit 706406ed6f

View file

@ -1,5 +1,6 @@
package jrummikub.view.impl;
import java.awt.Color;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -53,7 +54,8 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
/**
* Sets the current player name
*
* @param playerName the player name
* @param playerName
* the player name
*/
void setCurrentPlayerName(String playerName) {
currentPlayerNameLabel.setText(playerName);
@ -64,6 +66,11 @@ class PlayerPanel extends JPanel implements IPlayerPanel {
timeBar.setValue(time);
timeBar.setString(Integer.toString(time / 60) + ":"
+ secondFormat.format(time % 60));
if (time <= 10)
timeBar.setForeground(Color.RED);
else
timeBar.setForeground(Color.BLACK);
}
@Override