forked from leehyelim0691/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnding.java
More file actions
44 lines (36 loc) · 1.11 KB
/
Ending.java
File metadata and controls
44 lines (36 loc) · 1.11 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
import java.awt.*;
import javax.swing.*;
public class Ending{
JFrame frame;
MyPanel panel;
public Ending(){
frame = new JFrame("Move Label");
panel=new MyPanel();
}
public void play(){
frame.setTitle("Ending");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(panel,BorderLayout.CENTER);
frame.setLocation(100,100);
frame.setSize(800,500);
frame.setVisible(true);
}
class MyPanel extends JPanel{
ImageIcon icon;
Image img;
public MyPanel(){
icon=new ImageIcon("picture/handong.png");
img=icon.getImage();
}
public void paintComponent(Graphics g){
super.paintComponent(g);
g.drawImage(img, 0, 0, this.getWidth(), this.getHeight(), this);
g.setFont(new Font("myFont",Font.BOLD ,50));
g.setColor(Color.BLACK);
g.drawString("Handong University", 140, 70);
g.setFont(new Font("secondFont",Font.PLAIN,20));
g.setColor(Color.WHITE);
g.drawString("To school..",10,430);
}
}
}