-
Notifications
You must be signed in to change notification settings - Fork 0
/
DBSU.java
63 lines (50 loc) · 1.63 KB
/
DBSU.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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
public class DBSU extends JFrame{
private JTextField url = new JTextField();
private JTextField dbn = new JTextField();
private JTextField user = new JTextField();
private JTextField pass = new JTextField();
private JTextField suser = new JTextField();
private JTextField spass = new JTextField();
private JLabel urll = new JLabel("Enter URL:");
private JLabel dbl = new JLabel("Enter DB name:");
private JLabel userl = new JLabel("Enter DB User name:");
private JLabel passl = new JLabel("Enter DB Passward:");
private JLabel snam = new JLabel("Enter User name:");
private JLabel spa = new JLabel("Enter Passowerd:");
private JPanel pcenter = new JPanel();
private JPanel psouth = new JPanel();
private JButton ok = new JButton("Enter");
private settingsDB dbs = new settingsDB();
private users us = new users();
public DBSU(){
pcenter.setLayout(new GridLayout(6,2));
pcenter.add(urll);
pcenter.add(url);
pcenter.add(dbl);
pcenter.add(dbn);
pcenter.add(userl);
pcenter.add(user);
pcenter.add(passl);
pcenter.add(pass);
pcenter.add(snam);
pcenter.add(suser);
pcenter.add(spa);
pcenter.add(spass);
add(pcenter, BorderLayout.CENTER);
add(ok, BorderLayout.SOUTH);
ok.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
dbs.seturl(url.getText(), dbn.getText(), user.getText(), pass.getText());
dbs.setFruitTab();
dbs.setUserTab();
us.addUser(Integer.parseInt(suser.getText()), Integer.parseInt(spass.getText()),
"m", "Admin");
dispose();
}
});
}
}