-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoodbye.java
More file actions
58 lines (53 loc) · 1.6 KB
/
Goodbye.java
File metadata and controls
58 lines (53 loc) · 1.6 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
import java.awt.*;
import javax.swing.*;
public class Goodbye {
/**
* Goodbye class of Slide Into Highschool, shows goodbye message
*
* <h2>Course Info:</h2>
* ICS4UP with Krasteva, V.
* Date: June 5st, 2023
* Time Spent: 0.5 hrs
* @version 1
* @author Charlie To, Milena Mofrad
*/
JFrame frame;
/**
* Constructor method
*
* @param frame
* @return name Function
*/
public Goodbye(JFrame frame){
this.frame = frame;
// Clear the frame
Container contentPane = frame.getContentPane();
contentPane.removeAll();
this.frame.revalidate();
this.frame.repaint();
MainMenu.setIsGoodbye(true);
}
public void run(){
frame.getContentPane().add(new Drawing());
frame.setVisible(true);
}
class Drawing extends JComponent {
public void paint(Graphics g) {
super.paintComponent(g);
// BACKGROUND
System.out.println("goodbye");
g.setColor(Colours.darkerBlue);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(Colours.backgroundBlue);
g.fillRect(20, 20, getWidth()-40, getHeight()-40);
// NUMBERS
g.setColor(Color.WHITE);
g.setFont(Colours.title);
g.drawString("Goodbye!", 300, 90);
g.setFont(new Font("Roboto", Font.PLAIN, 25));
g.drawString("Thank you for playing our game", 100, 170);
g.drawString("We hope to see you play again soon", 100, 250);
g.drawString("Press any key to exit", 100, 350);
}
}
}