Repository navigation
Expand file tree
/
Copy pathSwingApp.java
More file actions
90 lines (63 loc) · 1.63 KB
/
Copy pathSwingApp.java
File metadata and controls
90 lines (63 loc) · 1.63 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
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
import javax.swing.SwingUtilities;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class SwingApp {
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JFrame app = new Signin();
app.setVisible(true);
}
});
}
}
class Signin extends JFrame {
private JPanel jContentPane = null;
private JButton jSignupButton = null;
Signin() {
super();
setSize(400, 250);
setResizable(false);
setContentPane(getJContentPane());
setTitle("Signin Form");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
private JButton getJSignupButton() {
jSignupButton = new JButton("Sign Up");
jSignupButton.setBounds(30, 10, 100, 30);
jSignupButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JFrame s = new Signup();
s.setVisible(true); // show signup frame
setVisible(false); // hide current frame
}
});
return jSignupButton;
}
private JPanel getJContentPane() {
jContentPane = new JPanel();
jContentPane.setLayout(null);
jContentPane.add(getJSignupButton());
return jContentPane;
}
}
class Signup extends JFrame {
private JPanel jContentPane = null;
Signup() {
super();
setSize(400, 250);
setResizable(false);
setContentPane(getJContentPane());
setTitle("Signup Form");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
private JPanel getJContentPane() {
jContentPane = new JPanel();
jContentPane.setLayout(null);
// jContentPane.add();
return jContentPane;
}
}