-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAzulFrame.java
More file actions
31 lines (28 loc) · 775 Bytes
/
AzulFrame.java
File metadata and controls
31 lines (28 loc) · 775 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
import javax.swing.JFrame;
import javax.swing.ImageIcon;
import java.awt.*;
import javax.swing.*;
import java.awt.image.*;
import javax.imageio.ImageIO;
public class AzulFrame extends JFrame{
private static final int WIDTH = 1600;
private static final int HEIGHT = 1000;
private BufferedImage icon;
public AzulFrame(String title) {
super(title);
setSize(WIDTH, HEIGHT);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
add(new MainPanel());
setLocationRelativeTo(null);//makes window appear in middle of screen
setVisible(true);
try {
icon = ImageIO.read(AzulFrame.class.getResource("/Images/AzulGameIcon.png"));
}
catch(Exception E) {
System.out.println("Exception Error");
E.printStackTrace();
return;
}
setIconImage(icon);
}
}