-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrogGame_new.java
122 lines (100 loc) · 4 KB
/
FrogGame_new.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* @(#)FrogGame.java
*
* FrogGame application
*
* @author
* @version 1.00 2016/5/31
*/
import java.awt.Component;
import javax.swing.*;
import java.awt.*;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.ImageIcon;
import javax.swing.JScrollPane;
import javax.swing.JLabel;
public class FrogGame_new extends JPanel {
public static JButton button_1,button_2,button_3,button_4;
public JLabel lab_frog, lab_button1, lab_button2, lab_button3, lab_button4;
public static JPanel Panel_new;
private ImageIcon backgroud_icon = new ImageIcon("Background.jpg");
private ImageIcon prog_icon = new ImageIcon("lv6.gif");
private ImageIcon button_icon = new ImageIcon("btnBig.gif");
public FrogGame_new(){
setBackground(Color.white);
setPreferredSize(new Dimension(800,600));
setLayout(null);
lab_frog = new JLabel("", prog_icon, SwingConstants.CENTER);
lab_frog.setHorizontalTextPosition(SwingConstants.RIGHT);
lab_frog.setVerticalTextPosition(SwingConstants.BOTTOM);
lab_button1 = new JLabel("", button_icon, SwingConstants.CENTER);
lab_button1.setHorizontalTextPosition(SwingConstants.RIGHT);
lab_button1.setVerticalTextPosition(SwingConstants.BOTTOM);
lab_button2 = new JLabel("", button_icon, SwingConstants.CENTER);
lab_button2.setHorizontalTextPosition(SwingConstants.RIGHT);
lab_button2.setVerticalTextPosition(SwingConstants.BOTTOM);
lab_button3 = new JLabel("", button_icon, SwingConstants.CENTER);
lab_button3.setHorizontalTextPosition(SwingConstants.RIGHT);
lab_button3.setVerticalTextPosition(SwingConstants.BOTTOM);
lab_button4 = new JLabel("", button_icon, SwingConstants.CENTER);
lab_button4.setHorizontalTextPosition(SwingConstants.RIGHT);
lab_button4.setVerticalTextPosition(SwingConstants.BOTTOM);
Panel_new = new JPanel(){
public void paintComponent(Graphics g){
super.paintComponent(g);
g.drawImage(backgroud_icon.getImage(), 0, 0, this);
}
};
Panel_new.setBounds(0,0,800,600);
Panel_new.setLayout(null);
Panel_new.setVisible(true);
add(Panel_new);
button_1 = new JButton("시작하개굴");
button_2 = new JButton("도움말");
button_3 = new JButton("개발진");
button_4 = new JButton("끝내개굴");
// 2016-06-05
Color lab_color = new Color (62, 121, 8);
button_1.setBackground(lab_color);
button_2.setBackground(lab_color);
button_3.setBackground(lab_color);
button_4.setBackground(lab_color);
button_1.setForeground(Color.white);
button_2.setForeground(Color.white);
button_3.setForeground(Color.white);
button_4.setForeground(Color.white);
button_1.setOpaque(false);
button_2.setOpaque(false);
button_3.setOpaque(false);
button_4.setOpaque(false);
button_1.setFont(new Font("돋움", Font.BOLD, 15));
button_2.setFont(new Font("돋움", Font.BOLD, 15));
button_3.setFont(new Font("돋움", Font.BOLD, 15));
button_4.setFont(new Font("돋움", Font.BOLD, 15));
// by umji
lab_frog.setBounds(80,250,280,280);
lab_button1.setBounds(450,220,300,84);
lab_button2.setBounds(450,300,300,84);
lab_button3.setBounds(450,380,300,84);
lab_button4.setBounds(450,460,300,84);
// by umji 2016-06-05
button_1.setBounds(560,245,145,35);
button_2.setBounds(560,325,145,35);
button_3.setBounds(560,405,145,35);
button_4.setBounds(560,485,145,35);
//
Panel_new.add(button_1);
Panel_new.add(button_2);
Panel_new.add(button_3);
Panel_new.add(button_4);
Panel_new.add(lab_frog);
Panel_new.add(lab_button1);
Panel_new.add(lab_button2);
Panel_new.add(lab_button3);
Panel_new.add(lab_button4);
}// constructor
} // FrogGame_new class