private void initComponents() {
        setTitle("Import tables");
        TableListPanel = new javax.swing.JScrollPane();
        TableList = new javax.swing.JList();
        ImportSubmitButton = new javax.swing.JButton();
        SelectAllCheck = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setBounds(new java.awt.Rectangle(100, 100, 600, 400));
        
        contentPane = new JPanel();
        contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
        contentPane.setLayout(new BorderLayout(0, 0));
        setContentPane(contentPane);
        
        
        TableList.setPreferredSize(new Dimension(500,300));
        DefaultListModel tableModel = new DefaultListModel();
        for(Object str : names) {
            tableModel.addElement(str);
        }
        TableList.setModel(tableModel);
        TableListPanel.setViewportView(TableList);
        
        contentPane.add(TableList, BorderLayout.NORTH);
        
        JPanel panel = new JPanel();
        contentPane.add(panel, BorderLayout.SOUTH);
        JButton submitButton = new JButton("Import");
        submitButton.addActionListener(
                new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent arg0) {
                        
                        List<String> selectedTables = new ArrayList<String>();
                        List<String> orderedTables = new ArrayList<String>();
                        
                        int[] selectedIndices;
                        selectedIndices = TableList.getSelectedIndices();
                                               
                        for(int i : selectedIndices) {
                            selectedTables.add(fileNames.get(i));
                        }
                        
                        orderedTables = orderList(selectedTables);
                        //System.out.println(orderedTables.toString());
                        
                        try{
                            DatabaseImporter.importDatabase(zipName, orderedTables);
                            //Done twice for possible foreign key contraints. Ugly solution
                            DatabaseImporter.importDatabase(zipName, orderedTables);
                            selectionPanel.update();
                            getFrame().dispose();
                        }catch(Exception e)
                        {
                            JOptionPane.showMessageDialog(rootPane, "Couldn't import", "Error", JOptionPane.INFORMATION_MESSAGE);
                        }
                    }  
                                         
                });
        panel.add(submitButton);
        
        JCheckBox selectAll = new JCheckBox();
        selectAll.setLabel("Select all");
        selectAll.addItemListener(new ItemListener() 
            {
                @Override
                public void itemStateChanged(ItemEvent e)
                {
                    if(e.getStateChange() == ItemEvent.SELECTED)
                    {
                        int[] indices = new int[names.size()];
                        for(int iter = 0; iter < names.size(); iter++)
                        {
                            indices[iter] = iter;
                        }
                        TableList.setSelectedIndices(indices);
                        TableList.setEnabled(false);
                    } 
                    else
                    {
                        TableList.clearSelection();
                        TableList.setEnabled(true);
                    }
                }
            });
        panel.add(selectAll);
    }