-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewFrame.java
More file actions
40 lines (32 loc) · 756 Bytes
/
ViewFrame.java
File metadata and controls
40 lines (32 loc) · 756 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
import java.awt.event.*;
import javax.swing.*;
public class ViewFrame extends JFrame
{
JTextArea ta;
JScrollPane sp1;
public ViewFrame()
{
super("View All Employee");
setSize(500,150);
setResizable(false);
ta=new JTextArea(10,10);
ta.setEditable(false);
sp1=new JScrollPane(ta);
sp1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
sp1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
add(sp1);
DatabaseHandler q=new DatabaseHandler();
String s=q.query();
ta.setText(s);
setLocationRelativeTo(null);
setVisible(true);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
HomeFrame h=new HomeFrame();
dispose();
}
});
}
}