private JButton button() { JButton result = new JButton(((StudentSemesterPlan) _plan.getSemester(_year, _semester)).getTitle()); result.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { _planViewPanel.setSelectedSemester(_year, _semester); } }); return result; }
private JList courseList() { JList result = new JList((ListModel) _plan.getSemester(_year, _semester)); result.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); result.setCellRenderer(_planViewCellRenderer); result.addListSelectionListener( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (_courseList.getSelectedIndex() > -1) { _planViewPanel.courseSelected( (Course) _courseList.getModel().getElementAt(_courseList.getSelectedIndex()), _year, _semester); // _planViewPanel.setSelectedSemester(_year, _semester); } } }); return result; }