4 import javax
.swing
.event
.*;
5 import javax
.swing
.table
.*;
9 public class StudentSelectionListener
10 implements ListSelectionListener
12 private JTable master
;
13 private JTable detail
;
15 public StudentSelectionListener(JTable master
, JTable detail
)
21 public void valueChanged(ListSelectionEvent e
)
23 if (e
.getValueIsAdjusting()) return;
25 int m_idx
= master
.convertRowIndexToModel(master
.getSelectedRow());
27 Object student_o
= master
.getModel().getValueAt(m_idx
, 0);
28 if (student_o
instanceof Student
) {
29 Student student
= (Student
) student_o
;
31 TableModel tmodel_o
= detail
.getModel();
32 if (tmodel_o
instanceof SessionTableModel
) {
33 SessionTableModel tmodel
= (SessionTableModel
) tmodel_o
;
35 tmodel
.update_student_sessions(student
.get_id());