-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashScreen.java
More file actions
82 lines (74 loc) · 2.37 KB
/
SplashScreen.java
File metadata and controls
82 lines (74 loc) · 2.37 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import javax.swing.*;
import java.awt.*;
/**
* Splashscreen class Slide Into Highschool, runs the animated splash screen
*
* <h2>Course Info:</h2>
* ICS4UP with Krasteva, V.
* Date: June 8th, 2023
* Time Spent: 4 hrs
* @version 1
* @author Charlie To, Milena Mofrad
*/
public class SplashScreen {
/**
* Constructor method
*/
public SplashScreen() {
JFrame frame = new JFrame("Slide Into Highschool");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(1200, 840);
frame.add(new Drawing());
frame.setVisible(true);
}
public static void main(String[] args) {
new SplashScreen();
}
class Drawing extends JComponent {
public void paint(Graphics g) {
Color backBlue = new Color(0, 155, 232);
Color floorYellow = new Color(244, 196, 48);
Color potBrown = new Color(160, 100, 20);
Color stemBrown = new Color(100, 50, 10);
Color plantGreen = new Color(37, 82, 59);
Color white = new Color(255, 255, 255);
Font largeSerifFont = new Font("Serif", Font.BOLD, 50);
g.setFont(largeSerifFont);
/** Background */
g.setColor(backBlue);
g.fillRect(0, 0, 1200, 800);
/** Floor */
g.setColor(floorYellow);
g.fillRect(0, 700, 1200, 800);
/** Plant */
int[] xQuad = { 100, 200, 180, 120 };
int[] yQuad = { 600, 600, 700, 700 };
g.setColor(potBrown);
g.fillPolygon(xQuad, yQuad, 4);
/** Stem */
g.setColor(stemBrown);
g.fillRect(140, 300, 20, 300);
g.setColor(plantGreen);
g.fillOval(100, 400, 100, 150);
g.fillOval(100, 300, 100, 150);
g.fillOval(100, 200, 100, 150);
/** Plant */
int[] xQuad1 = { 1000, 1100, 1080, 1020 };
int[] yQuad1 = { 600, 600, 700, 700 };
g.setColor(potBrown);
g.fillPolygon(xQuad1, yQuad1, 4);
/** Stem */
g.setColor(stemBrown);
g.fillRect(1040, 300, 20, 300);
g.setColor(plantGreen);
g.fillOval(1000, 400, 100, 150);
g.fillOval(1000, 300, 100, 150);
g.fillOval(1000, 200, 100, 150);
/** Text */
g.setColor(white);
g.drawString("Slide", 550, 300);
g.drawString("Into", 550, 400);
g.drawString("High School", 500, 500);
}
}
}