private JButton mRightBt, mLeftBt, mUpBt, mDownBt;
private ArrayList<CustomizableItemsListener> mListeners;
public CustomizableItemsPanel(String leftText, String rightText) {
super(new GridLayout(1,2));
mListeners = new ArrayList<CustomizableItemsListener>();
String msg;
JPanel leftPanel=new JPanel(new BorderLayout());
JPanel rightPanel=new JPanel(new BorderLayout());
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);
}
}
);
mLeftLabel=new JLabel(leftText);
mRightLabel=new JLabel(rightText);
mLeftLabel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
mRightLabel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0));
leftPanel.add(mLeftLabel,BorderLayout.NORTH);
rightPanel.add(mRightLabel,BorderLayout.NORTH);
leftPanel.add(new JScrollPane(mLeftList),BorderLayout.CENTER);
rightPanel.add(new JScrollPane(mRightList),BorderLayout.CENTER);
JPanel leftButtons=new JPanel(new GridLayout(2,1));
JPanel rightButtons=new JPanel(new GridLayout(2,1));
JPanel panel2=new JPanel(new BorderLayout());
JPanel panel3=new JPanel(new BorderLayout());
JPanel panel4=new JPanel(new BorderLayout());
JPanel panel5=new JPanel(new BorderLayout());