System.exit(0);
    private void createUI() {        try {            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());        } catch (Exception e) {            LoggingSystem.getLogger().log(Level.WARNING,                    "Could not set native look and feel.");        }        addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent e) {                dispose();                System.exit(0);            }        });        setTitle("Select Display Settings");        // The panels...        JPanel mainPanel = new JPanel();        JPanel centerPanel = new JPanel();        JPanel optionsPanel = new JPanel();        JPanel buttonPanel = new JPanel();        // The buttons...        JButton ok = new JButton("Ok");        JButton cancel = new JButton("Cancel");        icon = new JLabel(imageFile != null ? new ImageIcon(imageFile) : null);        mainPanel.setLayout(new BorderLayout());        centerPanel.setLayout(new BorderLayout());        KeyListener aListener = new KeyAdapter() {            public void keyPressed(KeyEvent e) {                if (e.getKeyCode() == KeyEvent.VK_ENTER) {                    if (verifyAndSaveCurrentSelection())                        dispose();                }            }        };        displayResCombo = setUpResolutionChooser();        displayResCombo.addKeyListener(aListener);        colorDepthCombo = new JComboBox();        colorDepthCombo.addKeyListener(aListener);        displayFreqCombo = new JComboBox();        displayFreqCombo.addKeyListener(aListener);        fullscreenBox = new JCheckBox("Fullscreen?");        fullscreenBox.setSelected(source.getFullscreen());        rendererCombo = setUpRendererChooser();        rendererCombo.addKeyListener(aListener);        updateDisplayChoices();        optionsPanel.add(displayResCombo);        optionsPanel.add(colorDepthCombo);        optionsPanel.add(displayFreqCombo);        optionsPanel.add(fullscreenBox);        optionsPanel.add(rendererCombo);        // Set the button action listeners. Cancel disposes without saving, OK        // saves.        ok.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                if (verifyAndSaveCurrentSelection())                    dispose();            }        });        cancel.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent e) {                dispose();                System.exit(0);            }        });        buttonPanel.add(ok);        buttonPanel.add(cancel);        if (icon != null)            centerPanel.add(icon, BorderLayout.NORTH);        centerPanel.add(optionsPanel, BorderLayout.SOUTH);        mainPanel.add(centerPanel, BorderLayout.CENTER);        mainPanel.add(buttonPanel, BorderLayout.SOUTH);        this.getContentPane().add(mainPanel);        pack();        center();        showDialog();    }