-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbout.java
More file actions
51 lines (41 loc) · 1.57 KB
/
About.java
File metadata and controls
51 lines (41 loc) · 1.57 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
import java.awt.Font;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class About extends JFrame implements ActionListener {
About(){
setBounds(400, 100, 600, 500);
setLayout(null);
ImageIcon il = new ImageIcon(ClassLoader.getSystemResource("icons/windows.png"));
Image i2 = il.getImage().getScaledInstance(300, 60, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel headerIcon = new JLabel(i3);
headerIcon.setBounds(70, 40, 400, 60);
add(headerIcon);
ImageIcon i4 = new ImageIcon(ClassLoader.getSystemResource("icons/icon.png"));
Image i5 = i4.getImage().getScaledInstance(70, 70, Image.SCALE_DEFAULT);
ImageIcon i6 = new ImageIcon(i5);
JLabel icon = new JLabel(i6);
icon.setBounds(70, 180, 70, 70);
add(icon);
JLabel text = new JLabel("<html>Code for fun<br>Version 0.0.1</html>");
text.setBounds(150, 100, 500, 200);
text.setFont(new Font("SAN_SERIF", Font.PLAIN, 16));
add(text);
JButton b1 = new JButton("OK");
b1.setBounds(150, 350, 120, 25);
b1.addActionListener(this);
add(b1);
setVisible(true);
}
public void actionPerformed(ActionEvent ae){
this.setVisible(false);
}
public static void main(String[] args) {
new About();
}
}