forked from NAYEMA26/Recursive_Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWelcome Window
161 lines (126 loc) · 4.61 KB
/
Welcome Window
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package notepad;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.Color;
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;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
/**
*
* @author NAYEMA FERDOUSHI
* PSTU 2102026 CSE
*/
public class WelcomeWindow extends JFrame implements ActionListener {
JLabel lab,labAurthor, lab1, lab2, lab3;
JTextField ctf;
JPasswordField ppf;
JButton but_next, but_clr, but_back;
WelcomeWindow()
{
super("Patuakhali Science & Technology");
ImageIcon img1 = new ImageIcon(ClassLoader.getSystemResource("icon/pstu.icon.png"));
Image img2 = img1.getImage().getScaledInstance(50, 50,Image.SCALE_DEFAULT);
ImageIcon img3 = new ImageIcon(img2);
JLabel image = new JLabel(img3);
image.setBounds(170, 12, 50, 50);
add(image);
lab = new JLabel(" Recursive Editor");
lab.setForeground(Color.BLACK);
lab.setFont(new Font("AvantGrade",Font.BOLD, 28));
lab.setBounds(240, 70, 450, 40);
add(lab);
labAurthor = new JLabel("Author: Nayema Ferdoushi Version 1.0");
labAurthor.setForeground(Color.BLACK);
labAurthor.setFont(new Font("AvantGrade",Font.BOLD, 22));
labAurthor.setBounds(200, 120, 450, 40);
add(labAurthor);
lab1 = new JLabel("WELCOME TO PSTU ");
lab1.setForeground(Color.BLACK);
lab1.setFont(new Font("AvantGrade",Font.BOLD, 38));
lab1.setBounds(230, 12, 450, 40);
add(lab1);
lab2 = new JLabel ("ID No :");
lab2.setForeground(Color.BLACK);
lab2.setFont(new Font("Relway",Font.BOLD, 28));
lab2.setBounds(150, 190, 375, 30);
add(lab2);
ctf = new JTextField(15);
ctf.setBounds(325,190,230,30);
ctf.setFont(new Font("Arial",Font.BOLD,14));
add(ctf);
lab3 = new JLabel ("Password :");
lab3.setForeground(Color.BLACK);
lab3.setFont(new Font("Relway",Font.BOLD, 28));
lab3.setBounds(150, 250, 375, 30);
add(lab3);
ppf = new JPasswordField(15);
ppf.setBounds(325,250,230,30);
ppf.setFont(new Font("Arial",Font.BOLD,14));
add(ppf);
but_back = new JButton("BACK ");
but_back.setFont(new Font("Arial",Font.BOLD,14));
but_back.setForeground(Color.white);
but_back.setBackground(Color.black);
but_back.setBounds(325,300,100,30);
but_back.addActionListener(this);
add(but_back);
but_clr = new JButton("CLEAR ");
but_clr.setFont(new Font("Arial",Font.BOLD,14));
but_clr.setForeground(Color.white);
but_clr.setBackground(Color.black);
but_clr.setBounds(450,300,100,30);
but_clr.addActionListener(this);
add(but_clr);
but_next = new JButton("NEXT ");
but_next.setFont(new Font("Arial",Font.BOLD,14));
but_next.setForeground(Color.white);
but_next.setBackground(Color.black);
but_next.setBounds(325,350,230,30);
but_next.addActionListener(this);
add(but_next);
ImageIcon bimg1 = new ImageIcon(ClassLoader.getSystemResource("icon/backbg.png"));
Image bimg2 = bimg1.getImage().getScaledInstance(850, 480,Image.SCALE_DEFAULT);
ImageIcon bimg3 = new ImageIcon(bimg2);
JLabel bimage = new JLabel(bimg3);
bimage.setBounds(0, 0, 850, 480);
add(bimage);
setLayout(null);
setSize(850,480);
setLocationRelativeTo(null);
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e){
try{
if(e.getSource() == but_back)
{
setVisible(false);
}
else if(e.getSource() == but_clr)
{
//setVisible(false);
ctf.setText("");
ppf.setText("");
}
else if(e.getSource() == but_next)
{
GUI gui = new GUI();
String args[] = null;
gui.main(args);
}
}catch(Exception E){
E.printStackTrace();
}
}
public static void main(String[] args) {
new WelcomeWindow();
}
}