});
// ------------------------------------------------------------
final MainWindow _this = this;
final JFileChooser file_chooser;
FileSystemView file_system_view;
file_system_view = FileSystemView.getFileSystemView();
file_chooser = new JFileChooser( file_system_view );
file_chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
file_chooser.setMultiSelectionEnabled(false);
file_chooser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
if(event.getActionCommand() == JFileChooser.APPROVE_SELECTION) {
final File file = file_chooser.getSelectedFile();
(new JMThread(new JMRunnable() {
public void JMRun() {
try {
_server_manager.importList(file.getAbsolutePath());
} catch (Throwable e) {
e.printStackTrace();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JOptionPane.showMessageDialog(_this, "An error occured, most probably the file format is wrong", "Error Message",JOptionPane.ERROR_MESSAGE);
}
});
}
}
})).start();
}
}
});
import_server_list.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
System.out.println("Import server list entered");
file_chooser.showDialog(_this, "Choose");
}
});
new_downloads.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {