forked from ramyaj876/SE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeadFrame.java
More file actions
76 lines (71 loc) · 1.9 KB
/
DeadFrame.java
File metadata and controls
76 lines (71 loc) · 1.9 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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package se;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author acer
*/
public class DeadFrame {
JFrame f, W;
String U;
int score;
//JButton JB = new JButton("View Flood Fill");
DB db;
DeadFrame(String user)
{
f = new JFrame();
JPanel jPanel=new JPanel();
jPanel.add(new JLabel(new ImageIcon("2.jpg")));
f.add(jPanel);
f.setSize(1366,768);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
U = user;
}
void Score(int s, JFrame W)
{
this.score = s;
this.W = W;
}
void screenF()
{
W.setVisible(false);
Disp D = new Disp();
f.add(D);
db = new DB();
db.connDB();
f.setVisible(true);
if (db.viewHS(U) < score)
{ db.updateHS(U, score);
JOptionPane.showMessageDialog(null, "Congratulations! New High Score :DD");
db.closeDB();
}
else
{
JOptionPane.showMessageDialog(null, "Move on?");
f.setVisible(false);
Options O = new Options(U);
db.closeDB();
}
}
class Disp extends JPanel {
@Override
public void paint(Graphics g) {
g.setColor(Color.blue);
g.setFont(new Font("TimesRoman", Font.BOLD, 30));
String str = "You're DEAD\n\n Score:"+score;
g.drawString(str, 150, 50);
}
}
}