-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessagesPanelView.java
More file actions
33 lines (26 loc) · 985 Bytes
/
MessagesPanelView.java
File metadata and controls
33 lines (26 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.border.EmptyBorder;
public class MessagesPanelView extends JPanel {
private JLabel balanceLabel, statusLabel, messageLabel;
public MessagesPanelView(int UNIT, String balance, String message, String status) {
setLayout(new BorderLayout());
setBorder(new EmptyBorder(0, 0, UNIT, 0));
balanceLabel = new JLabel(balance);
messageLabel = new JLabel(message);
statusLabel = new JLabel(status);
this.add(balanceLabel, BorderLayout.NORTH);
this.add(messageLabel, BorderLayout.CENTER);
this.add(statusLabel, BorderLayout.SOUTH);
}
public void updateEndGame(String status) {
statusLabel.setText(status);
}
public void updateMessage(String message) {
messageLabel.setText(message);
}
public void updateBalance(String balance) {
balanceLabel.setText(balance);
}
}