-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGraduationPanel.java
48 lines (43 loc) · 1.34 KB
/
GraduationPanel.java
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
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.imageio.ImageIO;
import java.io.*;
/**
* Creates a panel for the end of the game. Does not lead to any other panel.
*
* @author Giulia Bronzi
* @author Zahra Thabet
* @author Nolen Belle Bryant
* @version 12.17.18
*/
public class GraduationPanel extends JPanel
{
/**
* Constructor for objects of class GraduationPanel. Creates a graduation
* panel
*/
public GraduationPanel()
{
//creates background panel
JPanel background = new JPanel();
background.setLayout(new BorderLayout());
background.setOpaque(true);
//adding sev green photo to background
try {
//scaling all input files to be the same size
ImageIcon image =
new ImageIcon(ImageIO.read(new File("images/sevGreen.jpg")));
Image pic = image.getImage(); // transform it
// scale it the smooth way
Image newimg =
pic.getScaledInstance(1200, 770,java.awt.Image.SCALE_SMOOTH);
image = new ImageIcon(newimg); // transform it back
background.add(new JLabel(image), BorderLayout.CENTER);
}catch (IOException e) {
e.printStackTrace();
}
add(background);
}
}