tie UI Student table to database student table
[se-panther.git] / gui-playground / src / panther / ui / PtMainPanel.java
blobaf6fdca4d89963756bed234ea8e23f7377f206ac
1 package panther.ui;
3 import java.awt.*;
4 import javax.swing.*;
5 import javax.swing.event.*;
6 import javax.swing.table.*;
8 public class PtMainPanel
9 extends JPanel
11 public PtMainPanel()
13 /* BoxLayout along x-axis may not be what we want here, this is just a
14 * quick and dirty solution to get panels to resize with frame resize
15 * events. */
16 setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
18 JTable tbl_student = new StudentTable();
19 JTable tbl_session = new SessionTable();
21 tbl_student.getSelectionModel().addListSelectionListener(
22 new StudentSelectionListener(tbl_student, tbl_session));
25 JPanel pnl_student = new JPanel();
27 pnl_student.setLayout(new BorderLayout());
28 pnl_student.setBorder(BorderFactory.createTitledBorder(
29 BorderFactory.createTitledBorder("Student")));
30 pnl_student.add(new JScrollPane(tbl_student));
32 JPanel pnl_session = new JPanel();
34 pnl_session.setLayout(new BorderLayout());
35 pnl_session.setBorder(BorderFactory.createTitledBorder(
36 BorderFactory.createTitledBorder("Session")));
37 pnl_session.add(new JScrollPane(tbl_session));
39 add(pnl_student);
40 add(pnl_session);
42 // add(new StudentPanel());
43 // add(new SessionPanel());