-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUsersPanel.java
More file actions
31 lines (26 loc) · 862 Bytes
/
UsersPanel.java
File metadata and controls
31 lines (26 loc) · 862 Bytes
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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.awt.geom.Arc2D;
class UsersPanel extends JPanel{
String[] user_features = {"First Name","Last Name", "Telephone Number","Gender"};
public UsersPanel(DB database,int width,int height){
setPreferredSize(new Dimension(width,height));
setBackground(Color.BLUE);
setLayout(new GridBagLayout());
GridBagConstraints cons = new GridBagConstraints();
cons.fill = GridBagConstraints.VERTICAL;
cons.gridx = 1;cons.gridy = 0;
cons.insets = new Insets(20,0,0,0);
add(new JLabel("View Registered Users",JLabel.CENTER),cons);
//Table of the register users
cons.gridy = 3;
try{
add(new JTable(database.GetUsers(),user_features),cons);
}catch(Exception ex){
ex.printStackTrace();
add(new JLabel("No Users Found",JLabel.CENTER),cons);
}
}
}