public void displayPlayerInfo() { playerLabel = new JLabel("player: " + parentPanel.Player.getName()); playerLabel.setForeground(Color.white); add(playerLabel); scoreLabel = new JLabel("score: " + parentPanel.Player.getScore()); scoreLabel.setForeground(Color.white); add(scoreLabel); validate(); repaint(); }
public void refreshScore() { scoreLabel.setText("score: " + parentPanel.Player.getScore()); validate(); repaint(); }