forked from mlburggr/checkers_finalproject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameOverPanelBlack.java
More file actions
63 lines (60 loc) · 1.99 KB
/
Copy pathGameOverPanelBlack.java
File metadata and controls
63 lines (60 loc) · 1.99 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/******************************************
*
* Official Name: Maxwell Burggraf
*
* Nickname: Max
*
* E-mail: mlburggr@syr.edu
*
* Final Project: 2-player checkers game
*
* Compiler: drJava on a pc
*
* Date: Dec. 2, 2013
*
*******************************************/
import java.awt.*;
import java.awt.event.*;
import javax. swing. *;
public class GameOverPanelBlack extends JPanel {
private boolean playPressed=false;
public GameOverPanelBlack(String playername){
setLayout(null);
setPreferredSize(new Dimension(500, 500));
setBackground(Color.black);
//DR
JLabel title = new JLabel("");
title.setText("<html><font color='white'><font size=30>"+playername+" wins!!!</font></html>");
title.setLocation(175,0);
title.setSize(200,200);
JLabel credit = new JLabel("<html><font color='white'>Go back to main menu?</font></html>");
credit.setLocation(200,0);
credit.setSize(100,300);
JButton play = new JButton("Main Menu");
play.setLocation(220,350);
play.setSize(100,50);
add(title);
add(credit);
play.addActionListener(new ButtonListener());
add(play);
}
//LI
private class ButtonListener implements ActionListener
{
public void actionPerformed(ActionEvent event)
{
setVisible(false);
JFrame window = new JFrame("Checkers");
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
TitlePanel game = new TitlePanel();
window.getContentPane().add(game);
window.pack();
window.setVisible(true);
window.setBackground(Color.black);
window.setResizable(false);
}
}
public boolean isPressed(){
return playPressed;
}
}