From 706406ed6ffe788794268a4ab4e05403cf482dfa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 6 May 2011 03:56:23 +0200 Subject: 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 --- src/jrummikub/view/impl/PlayerPanel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/jrummikub/view/impl') diff --git a/src/jrummikub/view/impl/PlayerPanel.java b/src/jrummikub/view/impl/PlayerPanel.java index b7bdb32..9c12a80 100644 --- a/src/jrummikub/view/impl/PlayerPanel.java +++ b/src/jrummikub/view/impl/PlayerPanel.java @@ -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 -- cgit v1.2.3