-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathScore.java
55 lines (44 loc) · 1.35 KB
/
Score.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
49
50
51
52
53
54
55
package quizapplication;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Score extends JFrame implements ActionListener{
String name;
public int score;
Score(String name,int score){
this.name=name;
setBounds(300,100,800,600);
getContentPane().setBackground(new Color(187,198,226));
setLayout(null);
ImageIcon i1=new ImageIcon(ClassLoader.getSystemResource("icons/score.png"));
JLabel image=new JLabel(i1);
image.setBounds(0,100,500,400);
add(image);
JLabel heading=new JLabel("Thank You " +name+".");
heading.setBounds(50,30,600,30);
heading.setFont(new Font("Tahoma",Font.PLAIN,26));
add(heading);
JLabel title=new JLabel("Congratulations");
title.setBounds(525,120,300,30);
title.setFont(new Font("Tahoma",Font.PLAIN,26));
add(title);
JLabel lblscore=new JLabel("Your score is "+score);
lblscore.setBounds(525,150,320,30);
lblscore.setFont(new Font("Tahoma",Font.PLAIN,26));
add(lblscore);
JButton submit=new JButton("Play again");
submit.setBounds(525,300,150,30);
submit.setBackground(new Color(30,144,254));
submit.setForeground(Color.WHITE);
submit.addActionListener(this);
add(submit);
setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
setVisible(false);
new Login();
}
public static void main(String[] args) {
new Score("User",0);
}
}