private void createGui() {
setTitle(mLocalizer.msg("title", "Channel changes"));
setLocationRelativeTo(getParent());
JPanel contentPanel = new JPanel();
contentPanel.setLayout(new GridLayout(1, 2, 10, 0));
JPanel panelAdded = new JPanel(new BorderLayout());
panelAdded.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg("added", "New channels: {0}", mAddedList.size())));
DefaultListModel listModel = new DefaultListModel();
for (int i = 0; i < mAddedList.size(); i++) {
listModel.addElement(mAddedList.get(i));
}
ChannelJList list = new ChannelJList(listModel);
list.setCellRenderer(new ChannelListCellRenderer(true, true));
panelAdded.add(new JScrollPane(list), BorderLayout.CENTER);
JPanel panelDeleted = new JPanel(new BorderLayout());
panelDeleted.setBorder(BorderFactory.createTitledBorder(mLocalizer.msg("deleted", "Removed channels: {0}", mDeletedList.size())));
listModel = new DefaultListModel();
for (int i = 0; i < mDeletedList.size(); i++) {
listModel.addElement(mDeletedList.get(i));
}
list = new ChannelJList(listModel);
list.setCellRenderer(new ChannelListCellRenderer(true, true));
panelDeleted.add(new JScrollPane(list), BorderLayout.CENTER);
JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
JButton ok = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
btnPanel.add(ok);
contentPanel.add(panelAdded);
contentPanel.add(panelDeleted);
JPanel pane = (JPanel) getContentPane();
pane.add(contentPanel, BorderLayout.CENTER);
pane.add(btnPanel, BorderLayout.SOUTH);
pane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
pack();
}