-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewFrame.java
More file actions
42 lines (31 loc) · 832 Bytes
/
ViewFrame.java
File metadata and controls
42 lines (31 loc) · 832 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
32
33
34
35
36
37
38
39
40
41
42
package app;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
import app.*;
public class ViewFrame extends JFrame{
JTextArea t;
JScrollPane sp;
public ViewFrame(){
super("View All Employees");
setSize(500,200);
setResizable(false);
t=new JTextArea(10,10);
t.setEditable(false);
sp=new JScrollPane(t);
sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
add(sp);
DatabaseHandler db = new DatabaseHandler();
t.setText(db.query());
setLocationRelativeTo(null);
setVisible(true);
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent we){
HomeFrame h = new HomeFrame();
dispose();
}
});
}
}