-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFlightInfo.java
More file actions
38 lines (28 loc) · 909 Bytes
/
FlightInfo.java
File metadata and controls
38 lines (28 loc) · 909 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
package airlinemanagementsystem;
import javax.swing.*;
import java.awt.*;
import java.sql.*;
import net.proteanit.sql.DbUtils;
public class FlightInfo extends JFrame{
public FlightInfo() {
getContentPane().setBackground(Color.WHITE);
setLayout(null);
JTable table = new JTable();
try {
Conn conn = new Conn();
ResultSet rs = conn.s.executeQuery("select * from flight");
table.setModel(DbUtils.resultSetToTableModel(rs));
} catch(Exception e) {
e.printStackTrace();
}
JScrollPane jsp = new JScrollPane(table);
jsp.setBounds(0, 0, 800, 500);
add(jsp);
setSize(800, 500);
setLocation(400, 200);
setVisible(true);
}
public static void main(String[] args) {
new FlightInfo();
}
}