-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgui.java
More file actions
executable file
·75 lines (68 loc) · 1.55 KB
/
gui.java
File metadata and controls
executable file
·75 lines (68 loc) · 1.55 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
import javax.swing.*;
import java.awt.Color;
import java.awt.GridLayout;
public class gui{
public void guiInit(){
JLabel usr, pass;
JRadioButton patR, docR;
ButtonGroup group;
JButton enter;
enter=new JButton("Enter");
JTextField username,password;
username=new JTextField();
password=new JTextField();
usr = new JLabel("Enter a username");
pass = new JLabel("Enter a password");
patR=new JRadioButton("Patient");
docR=new JRadioButton("Doctor");
group=new ButtonGroup();
group.add(docR);
group.add(patR);
JFrame createAcc;
createAcc=new JFrame("Create Account");
JPanel pan;
pan = new JPanel();
createAcc.setSize(450, 450);
pan.setLayout(new GridLayout(4,2,5,5));
pan.add(usr);
pan.add(username);
pan.add(pass);
pan.add(password);
pan.add(patR);
pan.add(docR);
pan.add(enter);
createAcc.setBackground(Color.WHITE);
createAcc.add(pan);
createAcc.setVisible(true);
}
public void login(){
JLabel usr, pass;
JButton enter;
enter=new JButton("Enter");
JTextField username,password;
username=new JTextField();
password=new JTextField();
usr = new JLabel("Username");
pass = new JLabel("Password");
JFrame logIn;
logIn=new JFrame("Log in");
JPanel pan;
pan = new JPanel();
logIn.setSize(450, 450);
pan.setLayout(new GridLayout(4,2,5,5));
pan.add(usr);
pan.add(username);
pan.add(pass);
pan.add(password);
pan.add(enter);
logIn.setBackground(Color.WHITE);
logIn.add(pan);
logIn.setVisible(true);
}
public static void main(String[] args){
System.out.println("Hello World!");
gui g = new gui();
g.guiInit();
g.login();
}
}