mLeftListModel = new DefaultListModel();
mLeftList = new JList(mLeftListModel);
mLeftList.setVisibleRowCount(10);
mLeftList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
mLeftList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
updateEnabled();
}
});
mRightListModel = new DefaultListModel();
mRightList = new JList(mRightListModel);
mRightList.setVisibleRowCount(10);
mRightList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
mRightList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
updateEnabled();
}
});
mLeftList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
fireLeftListSelectionChanged(e);
}
}
);
mRightList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
fireRightListSelectionChanged(e);
}
}
);