Example usage for javax.swing JOptionPane showInputDialog

List of usage examples for javax.swing JOptionPane showInputDialog

Introduction

In this page you can find the example usage for javax.swing JOptionPane showInputDialog.

Prototype

public static String showInputDialog(Component parentComponent, Object message, String title, int messageType)
        throws HeadlessException 

Source Link

Document

Shows a dialog requesting input from the user parented to parentComponent with the dialog having the title title and message type messageType.

Usage

From source file:com.cch.aj.entryrecorder.frame.MainJFrame.java

private void btnCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCheckActionPerformed
    Boolean isSave = false;// w  w w .  ja v a 2s. co  m
    String staff = "";
    String pass = "NO";
    if (this.currentEntry != null) {
        if (this.cbNeckRound.getSelectedIndex() != 0 && this.cbNeckComplete.getSelectedIndex() != 0
                && this.cbUnderTheHandle.getSelectedIndex() != 0 && this.cbBungIfDrilled.getSelectedIndex() != 0
                && this.cbBase.getSelectedIndex() != 0 && this.cbStrengthOfDrum.getSelectedIndex() != 0
                && this.cbWeightWithinRange.getSelectedIndex() != 0
                && this.cbColourTexture.getSelectedIndex() != 0
                && this.cbBungProvision.getSelectedIndex() != 0) {
            if (this.cbNeckRound.getSelectedIndex() != 2 && this.cbNeckComplete.getSelectedIndex() != 2
                    && this.cbUnderTheHandle.getSelectedIndex() != 2
                    && this.cbBungIfDrilled.getSelectedIndex() != 2 && this.cbBase.getSelectedIndex() != 2
                    && this.cbStrengthOfDrum.getSelectedIndex() != 2
                    && this.cbWeightWithinRange.getSelectedIndex() != 2
                    && this.cbColourTexture.getSelectedIndex() != 2
                    && this.cbBungProvision.getSelectedIndex() != 2) {
                isSave = true;
                pass = "YES";
            } else {
                String checker = JOptionPane.showInputDialog(this,
                        "the value is not within the range, please entry technician name.", "Warning",
                        JOptionPane.OK_OPTION);
                pass = "NO(" + checker + ")";
                if (!checker.equals("")) {
                    isSave = true;
                }
            }
            staff = this.txtCheckStaff.getText();
            this.txtCheckStaff.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Please complete all the checks.", "Warning",
                    JOptionPane.OK_OPTION);
        }

        if (isSave) {
            DefaultTableModel model = (DefaultTableModel) this.tblCheck.getModel();
            Date now = new Date();
            String time = new SimpleDateFormat("HH:mm").format(now);
            model.addRow(new Object[] { time, RecordKey.CHECK_NECK_ROUND, this.cbNeckRound.getSelectedItem(),
                    pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_NECK_COMPLETE,
                    this.cbNeckComplete.getSelectedItem(), pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_UNDER_THE_HANDLE,
                    this.cbUnderTheHandle.getSelectedItem(), pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_BUNG_IF_DRILLED,
                    this.cbBungIfDrilled.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.CHECK_BASE, this.cbBase.getSelectedItem(), pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_STRENGTH_OF_DRUM,
                    this.cbStrengthOfDrum.getSelectedItem(), pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_WEIGHT_WITHIN_RANGE,
                    this.cbWeightWithinRange.getSelectedItem(), pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_COLOUR_TEXTURE,
                    this.cbColourTexture.getSelectedItem(), pass, staff });
            model.addRow(new Object[] { time, RecordKey.CHECK_BUNG_PROVISION,
                    this.cbBungProvision.getSelectedItem(), pass, staff });

            ((AbstractTableModel) this.tblCheck.getModel()).fireTableDataChanged();

            //
            UpdateEntryData(now, (float) this.cbNeckRound.getSelectedIndex(), RecordKey.CHECK_NECK_ROUND, staff,
                    pass, this.cbNeckRound.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbNeckComplete.getSelectedIndex(), RecordKey.CHECK_NECK_COMPLETE,
                    staff, pass, this.cbNeckComplete.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbUnderTheHandle.getSelectedIndex(),
                    RecordKey.CHECK_UNDER_THE_HANDLE, staff, pass,
                    this.cbUnderTheHandle.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbBungIfDrilled.getSelectedIndex(),
                    RecordKey.CHECK_BUNG_IF_DRILLED, staff, pass,
                    this.cbBungIfDrilled.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbBase.getSelectedIndex(), RecordKey.CHECK_BASE, staff, pass,
                    this.cbBase.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbStrengthOfDrum.getSelectedIndex(),
                    RecordKey.CHECK_STRENGTH_OF_DRUM, staff, pass,
                    this.cbStrengthOfDrum.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbWeightWithinRange.getSelectedIndex(),
                    RecordKey.CHECK_WEIGHT_WITHIN_RANGE, staff, pass,
                    this.cbWeightWithinRange.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbColourTexture.getSelectedIndex(),
                    RecordKey.CHECK_COLOUR_TEXTURE, staff, pass,
                    this.cbColourTexture.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbBungProvision.getSelectedIndex(),
                    RecordKey.CHECK_BUNG_PROVISION, staff, pass,
                    this.cbBungProvision.getSelectedItem().toString());

            this.cbNeckRound.setSelectedIndex(0);
            this.cbNeckComplete.setSelectedIndex(0);
            this.cbUnderTheHandle.setSelectedIndex(0);
            this.cbBungIfDrilled.setSelectedIndex(0);
            this.cbBase.setSelectedIndex(0);
            this.cbStrengthOfDrum.setSelectedIndex(0);
            this.cbWeightWithinRange.setSelectedIndex(0);
            this.cbColourTexture.setSelectedIndex(0);
            this.cbBungProvision.setSelectedIndex(0);
        }
    }
}

From source file:com.cch.aj.entryrecorder.frame.MainJFrame.java

private void btnDropActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDropActionPerformed
    Boolean isSave = false;/*from  w  ww  .j  av a  2s .c o  m*/
    String staff = "";
    String pass = "NO";
    if (this.currentEntry != null) {
        if (this.cbDrop1.getSelectedIndex() != 0 && this.cbDrop2.getSelectedIndex() != 0
                && this.cbDrop3.getSelectedIndex() != 0 && this.cbDrop4.getSelectedIndex() != 0
                && this.cbDrop5.getSelectedIndex() != 0 && this.cbDrop6.getSelectedIndex() != 0
                && this.cbDrop7.getSelectedIndex() != 0 && this.cbDrop8.getSelectedIndex() != 0) {
            if (this.cbDrop1.getSelectedIndex() != 2 && this.cbDrop2.getSelectedIndex() != 2
                    && this.cbDrop3.getSelectedIndex() != 2 && this.cbDrop4.getSelectedIndex() != 2
                    && this.cbDrop5.getSelectedIndex() != 2 && this.cbDrop6.getSelectedIndex() != 2
                    && this.cbDrop7.getSelectedIndex() != 2 && this.cbDrop8.getSelectedIndex() != 2) {
                isSave = true;
                pass = "YES";
            } else {
                String checker = JOptionPane.showInputDialog(this,
                        "the value is not within the range, please entry technician name.", "Warning",
                        JOptionPane.OK_OPTION);
                pass = "NO(" + checker + ")";
                if (!checker.equals("")) {
                    isSave = true;
                }
            }
            staff = this.txtDropStaff.getText();
            this.txtDropStaff.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Please complete all the tests.", "Warning",
                    JOptionPane.OK_OPTION);
        }

        if (isSave) {
            DefaultTableModel model = (DefaultTableModel) this.tblDrop.getModel();
            Date now = new Date();
            String time = new SimpleDateFormat("HH:mm").format(now);
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_1, this.cbDrop1.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_2, this.cbDrop2.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_3, this.cbDrop3.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_4, this.cbDrop4.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_5, this.cbDrop5.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_6, this.cbDrop6.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_7, this.cbDrop7.getSelectedItem(), pass, staff });
            model.addRow(
                    new Object[] { time, RecordKey.DROP_TEST_8, this.cbDrop8.getSelectedItem(), pass, staff });

            ((AbstractTableModel) this.tblDrop.getModel()).fireTableDataChanged();

            //
            UpdateEntryData(now, (float) this.cbDrop1.getSelectedIndex(), RecordKey.DROP_TEST_1, pass, staff,
                    this.cbDrop1.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop2.getSelectedIndex(), RecordKey.DROP_TEST_2, pass, staff,
                    this.cbDrop2.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop3.getSelectedIndex(), RecordKey.DROP_TEST_3, pass, staff,
                    this.cbDrop3.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop4.getSelectedIndex(), RecordKey.DROP_TEST_4, pass, staff,
                    this.cbDrop4.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop5.getSelectedIndex(), RecordKey.DROP_TEST_5, pass, staff,
                    this.cbDrop5.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop6.getSelectedIndex(), RecordKey.DROP_TEST_6, pass, staff,
                    this.cbDrop6.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop7.getSelectedIndex(), RecordKey.DROP_TEST_7, pass, staff,
                    this.cbDrop7.getSelectedItem().toString());
            UpdateEntryData(now, (float) this.cbDrop8.getSelectedIndex(), RecordKey.DROP_TEST_8, pass, staff,
                    this.cbDrop8.getSelectedItem().toString());
            this.cbDrop1.setSelectedIndex(0);
            this.cbDrop2.setSelectedIndex(0);
            this.cbDrop3.setSelectedIndex(0);
            this.cbDrop4.setSelectedIndex(0);
            this.cbDrop5.setSelectedIndex(0);
            this.cbDrop6.setSelectedIndex(0);
            this.cbDrop7.setSelectedIndex(0);
            this.cbDrop8.setSelectedIndex(0);
        }
    }
}

From source file:com.cch.aj.entryrecorder.frame.MainJFrame.java

private void btnBungActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBungActionPerformed
    Boolean isSave = false;//  w ww . j a va2s  . c om
    String staff = "";
    String pass = "NO";
    if (this.currentEntry != null) {
        if (this.cbBung.getSelectedIndex() != 0) {
            if (this.cbBung.getSelectedIndex() != 1) {
                isSave = true;
                pass = "YES";
            } else {
                String checker = JOptionPane.showInputDialog(this,
                        "the value is not within the range, please entry technician name.", "Warning",
                        JOptionPane.OK_OPTION);
                pass = "NO(" + checker + ")";
                if (!checker.equals("")) {
                    isSave = true;
                }
            }
            staff = txtBungStaff.getText();
            this.txtBungStaff.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Please select the tap position.", "Warning",
                    JOptionPane.OK_OPTION);
        }

        if (isSave) {
            DefaultTableModel model = (DefaultTableModel) this.tblBung.getModel();
            Date now = new Date();
            String time = new SimpleDateFormat("HH:mm").format(now);
            Float value = (float) this.cbBung.getSelectedIndex();
            String stringValue = this.cbBung.getSelectedItem().toString();
            model.addRow(new Object[] { time, stringValue, pass, staff });
            ((AbstractTableModel) this.tblBung.getModel()).fireTableDataChanged();
            this.cbBung.setSelectedIndex(0);
            UpdateEntryData(now, value, RecordKey.BUNG, staff, pass, stringValue);
        }
    }
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Loads the assertions from a URL (e.g. across the network)
 *//* w  ww  . j  a v a 2 s  .c  om*/
private void openOntologyUrl() {
    String urlString = null;
    URL url = null;

    do {
        try {
            urlString = JOptionPane.showInputDialog(this, "Input the URL for the remote ontology file to load.",
                    "Input Ontology File URL", JOptionPane.QUESTION_MESSAGE);
            if (urlString != null) {
                urlString = urlString.trim();
                if (urlString.length() > 0) {
                    url = new URL(urlString);
                }
            }
        } catch (Throwable throwable) {
            LOGGER.error("Unable to open the URL", throwable);
            JOptionPane.showMessageDialog(this, "Incorrect format for a URL, cannot be parsed\n" + urlString
                    + "\n\n" + throwable.getMessage(), "Incorrect URL Format", JOptionPane.ERROR_MESSAGE);
            url = null;
        }
    } while (url == null && urlString != null && urlString.length() > 0);

    if (url != null) {
        setupToLoadOntologyFile(new FileSource(url));
    }
}

From source file:com.cch.aj.entryrecorder.frame.MainJFrame.java

private void btnBore1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBore1ActionPerformed
    Boolean isSave = false;/*from ww w. jav a  2s  . c om*/
    String staff = "";
    String pass = "NO";
    String checker = "";
    if (this.currentEntry != null) {
        if (AppHelper.CheckTwoDigit(this.txtBore11.getText())
                && AppHelper.CheckTwoDigit(this.txtBore21.getText())
                && AppHelper.CheckTwoDigit(this.txtNeck1.getText())) {
            if (recordValidationService.Validate(currentEntry, RecordKey.THREAD_BORE1_2,
                    Float.parseFloat(this.txtBore11.getText()))
                    && recordValidationService.Validate(currentEntry, RecordKey.THREAD_BORE2_2,
                            Float.parseFloat(this.txtBore21.getText()))
                    && recordValidationService.Validate(currentEntry, RecordKey.THREAD_NECK_2,
                            Float.parseFloat(this.txtNeck1.getText()))) {
                isSave = true;

            } else {
                checker = JOptionPane.showInputDialog(this,
                        "the value is not within the range, please entry technician name.", "Warning",
                        JOptionPane.OK_OPTION);

                if (!checker.equals("")) {
                    isSave = true;
                }
            }
            staff = this.txtBoreStaff1.getText();
            this.txtBoreStaff1.setText("");
        } else {
            JOptionPane.showMessageDialog(this, "Please entry the valid number like (123.45).", "Warning",
                    JOptionPane.OK_OPTION);
        }

        if (isSave) {
            DefaultTableModel model = (DefaultTableModel) this.tblBore.getModel();
            Date now = new Date();
            String time = new SimpleDateFormat("HH:mm").format(now);
            Float valueBore1 = Float.parseFloat(this.txtBore11.getText());
            Float valueBore2 = Float.parseFloat(this.txtBore21.getText());
            Float valueNeck = Float.parseFloat(this.txtNeck1.getText());
            if (recordValidationService.Validate(currentEntry, RecordKey.THREAD_BORE1_2, valueBore1)) {
                pass = "YES";
            } else {
                pass = "NO(" + checker + ")";
            }
            model.addRow(new Object[] { time, RecordKey.THREAD_BORE1_2, valueBore1, pass, staff });
            UpdateEntryData(now, valueBore1, RecordKey.THREAD_BORE1_2, staff, pass, "");
            if (recordValidationService.Validate(currentEntry, RecordKey.THREAD_BORE2_2, valueBore2)) {
                pass = "YES";
            } else {
                pass = "NO(" + checker + ")";
            }
            model.addRow(new Object[] { time, RecordKey.THREAD_BORE2_2, valueBore2, pass, staff });
            UpdateEntryData(now, valueBore2, RecordKey.THREAD_BORE2_2, staff, pass, "");
            if (recordValidationService.Validate(currentEntry, RecordKey.THREAD_NECK_2, valueNeck)) {
                pass = "YES";
            } else {
                pass = "NO(" + checker + ")";
            }
            model.addRow(new Object[] { time, RecordKey.THREAD_NECK_2, valueNeck, pass, staff });
            UpdateEntryData(now, valueNeck, RecordKey.THREAD_NECK_2, staff, pass, "");

            ((AbstractTableModel) this.tblBore.getModel()).fireTableDataChanged();
            this.txtBore11.setText("");
            this.txtBore21.setText("");
            this.txtNeck1.setText("");
        }
    }
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Search for text in the assertions text area. If found, the window will
 * scroll to the text location and the matching text will be highlighted.
 * /*from   w  w w  . ja  va2  s  . c  om*/
 * @see #findNextTextInAssertionsTextArea()
 */
private void findTextInAssertionsTextArea() {
    String textToFind;
    boolean found;

    textToFind = JOptionPane.showInputDialog(this, "Enter the text to find in the assertions editor",
            "Find Assertions Text", JOptionPane.QUESTION_MESSAGE);

    if (textToFind != null && textToFind.trim().length() > 0) {
        // Select the assertions tab
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                tabbedPane.setSelectedIndex(TAB_NUMBER_ASSERTIONS);
            }
        });

        textToFind = textToFind.trim();
        found = TextSearch.getInstance().startSearch(assertionsInput, textToFind);

        if (!found) {
            JOptionPane.showMessageDialog(this, "The text [" + textToFind + "] was not found", "Not Found",
                    JOptionPane.INFORMATION_MESSAGE);
            setStatus("Did not find the assertions text: " + textToFind);
        } else {
            setStatus("Found matching text at line "
                    + TextSearch.getInstance().getLineOfLastMatch(assertionsInput));
        }
    } else {
        setStatus("No text entered to find");
    }
}

From source file:lu.fisch.unimozer.Diagram.java

public void command() {
    String cmd = JOptionPane.showInputDialog(frame, "Please enter the command you want to run.", "Run command",
            JOptionPane.QUESTION_MESSAGE);
    if (cmd != null) {
        try {//www . j  a  va  2  s .c o m
            Runtime5.getInstance().executeCommand(cmd);
        } catch (EvalError ex) {
            JOptionPane.showMessageDialog(frame, "Your command returned an error:\n\n" + ex.getMessage(),
                    "Error", JOptionPane.ERROR_MESSAGE, Unimozer.IMG_ERROR);
        }
    }
}

From source file:nz.govt.natlib.ndha.manualdeposit.ManualDepositMain.java

public String getInput(String header, String message) {
    return JOptionPane.showInputDialog(this, message, header, JOptionPane.QUESTION_MESSAGE);
}

From source file:nz.govt.natlib.ndha.manualdeposit.metadata.MetaDataConfigurator.java

public String getInput(final String header, final String message) {
    return JOptionPane.showInputDialog(this, message, header, JOptionPane.QUESTION_MESSAGE);
}

From source file:org.apache.log4j.chainsaw.LogUI.java

/**
 * Activates itself as a viewer by configuring Size, and location of itself,
 * and configures the default Tabbed Pane elements with the correct layout,
 * table columns, and sets itself viewable.
 *//*w  w  w.ja v  a  2  s . co  m*/
public void activateViewer() {
    LoggerRepository repo = LogManager.getLoggerRepository();
    if (repo instanceof LoggerRepositoryEx) {
        this.pluginRegistry = ((LoggerRepositoryEx) repo).getPluginRegistry();
    }
    initGUI();

    initPrefModelListeners();

    /**
     * We add a simple appender to the MessageCenter logger
     * so that each message is displayed in the Status bar
     */
    MessageCenter.getInstance().getLogger().addAppender(new AppenderSkeleton() {
        protected void append(LoggingEvent event) {
            getStatusBar().setMessage(event.getMessage().toString());
        }

        public void close() {
        }

        public boolean requiresLayout() {
            return false;
        }
    });

    initSocketConnectionListener();

    if (pluginRegistry.getPlugins(Receiver.class).size() == 0) {
        noReceiversDefined = true;
    }

    getFilterableColumns().add(ChainsawConstants.LEVEL_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.LOGGER_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.THREAD_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.NDC_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.PROPERTIES_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.CLASS_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.METHOD_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.FILE_COL_NAME);
    getFilterableColumns().add(ChainsawConstants.NONE_COL_NAME);

    JPanel panePanel = new JPanel();
    panePanel.setLayout(new BorderLayout(2, 2));

    getContentPane().setLayout(new BorderLayout());

    getTabbedPane().addChangeListener(getToolBarAndMenus());
    getTabbedPane().addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            LogPanel thisLogPanel = getCurrentLogPanel();
            if (thisLogPanel != null) {
                thisLogPanel.updateStatusBar();
            }
        }
    });

    KeyStroke ksRight = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
    KeyStroke ksLeft = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
    KeyStroke ksGotoLine = KeyStroke.getKeyStroke(KeyEvent.VK_G,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());

    getTabbedPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ksRight, "MoveRight");
    getTabbedPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ksLeft, "MoveLeft");
    getTabbedPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ksGotoLine, "GotoLine");

    Action moveRight = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            int temp = getTabbedPane().getSelectedIndex();
            ++temp;

            if (temp != getTabbedPane().getTabCount()) {
                getTabbedPane().setSelectedTab(temp);
            }
        }
    };

    Action moveLeft = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            int temp = getTabbedPane().getSelectedIndex();
            --temp;

            if (temp > -1) {
                getTabbedPane().setSelectedTab(temp);
            }
        }
    };

    Action gotoLine = new AbstractAction() {
        public void actionPerformed(ActionEvent e) {
            String inputLine = JOptionPane.showInputDialog(LogUI.this, "Enter the line number to go:",
                    "Goto Line", -1);
            try {
                int lineNumber = Integer.parseInt(inputLine);
                int row = getCurrentLogPanel().setSelectedEvent(lineNumber);
                if (row == -1) {
                    JOptionPane.showMessageDialog(LogUI.this, "You have entered an invalid line number",
                            "Error", 0);
                }
            } catch (NumberFormatException nfe) {
                JOptionPane.showMessageDialog(LogUI.this, "You have entered an invalid line number", "Error",
                        0);
            }
        }
    };

    getTabbedPane().getActionMap().put("MoveRight", moveRight);
    getTabbedPane().getActionMap().put("MoveLeft", moveLeft);
    getTabbedPane().getActionMap().put("GotoLine", gotoLine);

    /**
         * We listen for double clicks, and auto-undock currently selected Tab if
         * the mouse event location matches the currently selected tab
         */
    getTabbedPane().addMouseListener(new MouseAdapter() {
        public void mouseClicked(MouseEvent e) {
            super.mouseClicked(e);

            if ((e.getClickCount() > 1) && ((e.getModifiers() & InputEvent.BUTTON1_MASK) > 0)) {
                int tabIndex = getTabbedPane().getSelectedIndex();

                if ((tabIndex != -1) && (tabIndex == getTabbedPane().getSelectedIndex())) {
                    LogPanel logPanel = getCurrentLogPanel();

                    if (logPanel != null) {
                        logPanel.undock();
                    }
                }
            }
        }
    });

    panePanel.add(getTabbedPane());
    addWelcomePanel();

    getContentPane().add(toolbar, BorderLayout.NORTH);
    getContentPane().add(statusBar, BorderLayout.SOUTH);

    mainReceiverSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panePanel, receiversPanel);
    dividerSize = mainReceiverSplitPane.getDividerSize();
    mainReceiverSplitPane.setDividerLocation(-1);

    getContentPane().add(mainReceiverSplitPane, BorderLayout.CENTER);

    /**
     * We need to make sure that all the internal GUI components have been added to the
     * JFrame so that any plugns that get activated during initPlugins(...) method
     * have access to inject menus  
     */
    initPlugins(pluginRegistry);

    mainReceiverSplitPane.setResizeWeight(1.0);
    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent event) {
            exit();
        }
    });
    preferencesFrame.setTitle("'Application-wide Preferences");
    preferencesFrame.setIconImage(((ImageIcon) ChainsawIcons.ICON_PREFERENCES).getImage());
    preferencesFrame.getContentPane().add(applicationPreferenceModelPanel);

    preferencesFrame.setSize(750, 520);

    Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
    preferencesFrame.setLocation(new Point((screenDimension.width / 2) - (preferencesFrame.getSize().width / 2),
            (screenDimension.height / 2) - (preferencesFrame.getSize().height / 2)));

    pack();

    final JPopupMenu tabPopup = new JPopupMenu();
    final Action hideCurrentTabAction = new AbstractAction("Hide") {
        public void actionPerformed(ActionEvent e) {
            Component selectedComp = getTabbedPane().getSelectedComponent();
            if (selectedComp instanceof LogPanel) {
                displayPanel(getCurrentLogPanel().getIdentifier(), false);
                tbms.stateChange();
            } else {
                getTabbedPane().remove(selectedComp);
            }
        }
    };

    final Action hideOtherTabsAction = new AbstractAction("Hide Others") {
        public void actionPerformed(ActionEvent e) {
            Component selectedComp = getTabbedPane().getSelectedComponent();
            String currentName;
            if (selectedComp instanceof LogPanel) {
                currentName = getCurrentLogPanel().getIdentifier();
            } else if (selectedComp instanceof WelcomePanel) {
                currentName = ChainsawTabbedPane.WELCOME_TAB;
            } else {
                currentName = ChainsawTabbedPane.ZEROCONF;
            }

            int count = getTabbedPane().getTabCount();
            int index = 0;

            for (int i = 0; i < count; i++) {
                String name = getTabbedPane().getTitleAt(index);

                if (getPanelMap().keySet().contains(name) && !name.equals(currentName)) {
                    displayPanel(name, false);
                    tbms.stateChange();
                } else {
                    index++;
                }
            }
        }
    };

    Action showHiddenTabsAction = new AbstractAction("Show All Hidden") {
        public void actionPerformed(ActionEvent e) {
            for (Iterator iter = getPanels().entrySet().iterator(); iter.hasNext();) {
                Map.Entry entry = (Map.Entry) iter.next();
                Boolean docked = (Boolean) entry.getValue();
                if (docked.booleanValue()) {
                    String identifier = (String) entry.getKey();
                    int count = getTabbedPane().getTabCount();
                    boolean found = false;

                    for (int i = 0; i < count; i++) {
                        String name = getTabbedPane().getTitleAt(i);

                        if (name.equals(identifier)) {
                            found = true;

                            break;
                        }
                    }

                    if (!found) {
                        displayPanel(identifier, true);
                        tbms.stateChange();
                    }
                }
            }
        }
    };

    tabPopup.add(hideCurrentTabAction);
    tabPopup.add(hideOtherTabsAction);
    tabPopup.addSeparator();
    tabPopup.add(showHiddenTabsAction);

    final PopupListener tabPopupListener = new PopupListener(tabPopup);
    getTabbedPane().addMouseListener(tabPopupListener);

    this.handler.addPropertyChangeListener("dataRate", new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            double dataRate = ((Double) evt.getNewValue()).doubleValue();
            statusBar.setDataRate(dataRate);
        }
    });

    getSettingsManager().addSettingsListener(this);
    getSettingsManager().addSettingsListener(MRUFileListPreferenceSaver.getInstance());
    getSettingsManager().addSettingsListener(receiversPanel);
    try {
        //if an uncaught exception is thrown, allow the UI to continue to load
        getSettingsManager().loadSettings();
    } catch (Exception e) {
        e.printStackTrace();
    }
    //app preferences have already been loaded (and configuration url possibly set to blank if being overridden)
    //but we need a listener so the settings will be saved on exit (added after loadsettings was called)
    getSettingsManager().addSettingsListener(new ApplicationPreferenceModelSaver(applicationPreferenceModel));

    setVisible(true);

    if (applicationPreferenceModel.isReceivers()) {
        showReceiverPanel();
    } else {
        hideReceiverPanel();
    }

    removeSplash();

    synchronized (initializationLock) {
        isGUIFullyInitialized = true;
        initializationLock.notifyAll();
    }

    if (noReceiversDefined && applicationPreferenceModel.isShowNoReceiverWarning()) {
        SwingHelper.invokeOnEDT(new Runnable() {
            public void run() {
                showReceiverConfigurationPanel();
            }
        });
    }

    Container container = tutorialFrame.getContentPane();
    final JEditorPane tutorialArea = new JEditorPane();
    tutorialArea.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    tutorialArea.setEditable(false);
    container.setLayout(new BorderLayout());

    try {
        tutorialArea.setPage(ChainsawConstants.TUTORIAL_URL);
        JTextComponentFormatter.applySystemFontAndSize(tutorialArea);

        container.add(new JScrollPane(tutorialArea), BorderLayout.CENTER);
    } catch (Exception e) {
        MessageCenter.getInstance().getLogger().error("Error occurred loading the Tutorial", e);
    }

    tutorialFrame.setIconImage(new ImageIcon(ChainsawIcons.HELP).getImage());
    tutorialFrame.setSize(new Dimension(640, 480));

    final Action startTutorial = new AbstractAction("Start Tutorial",
            new ImageIcon(ChainsawIcons.ICON_RESUME_RECEIVER)) {
        public void actionPerformed(ActionEvent e) {
            if (JOptionPane.showConfirmDialog(null,
                    "This will start 3 \"Generator\" receivers for use in the Tutorial.  Is that ok?",
                    "Confirm", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                new Thread(new Tutorial()).start();
                putValue("TutorialStarted", Boolean.TRUE);
            } else {
                putValue("TutorialStarted", Boolean.FALSE);
            }
        }
    };

    final Action stopTutorial = new AbstractAction("Stop Tutorial",
            new ImageIcon(ChainsawIcons.ICON_STOP_RECEIVER)) {
        public void actionPerformed(ActionEvent e) {
            if (JOptionPane.showConfirmDialog(null,
                    "This will stop all of the \"Generator\" receivers used in the Tutorial, but leave any other Receiver untouched.  Is that ok?",
                    "Confirm", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                new Thread(new Runnable() {
                    public void run() {
                        LoggerRepository repo = LogManager.getLoggerRepository();
                        if (repo instanceof LoggerRepositoryEx) {
                            PluginRegistry pluginRegistry = ((LoggerRepositoryEx) repo).getPluginRegistry();
                            List list = pluginRegistry.getPlugins(Generator.class);

                            for (Iterator iter = list.iterator(); iter.hasNext();) {
                                Plugin plugin = (Plugin) iter.next();
                                pluginRegistry.stopPlugin(plugin.getName());
                            }
                        }
                    }
                }).start();
                setEnabled(false);
                startTutorial.putValue("TutorialStarted", Boolean.FALSE);
            }
        }
    };

    stopTutorial.putValue(Action.SHORT_DESCRIPTION,
            "Removes all of the Tutorials Generator Receivers, leaving all other Receivers untouched");
    startTutorial.putValue(Action.SHORT_DESCRIPTION,
            "Begins the Tutorial, starting up some Generator Receivers so you can see Chainsaw in action");
    stopTutorial.setEnabled(false);

    final SmallToggleButton startButton = new SmallToggleButton(startTutorial);
    PropertyChangeListener pcl = new PropertyChangeListener() {
        public void propertyChange(PropertyChangeEvent evt) {
            stopTutorial.setEnabled(((Boolean) startTutorial.getValue("TutorialStarted")).equals(Boolean.TRUE));
            startButton.setSelected(stopTutorial.isEnabled());
        }
    };

    startTutorial.addPropertyChangeListener(pcl);
    stopTutorial.addPropertyChangeListener(pcl);

    pluginRegistry.addPluginListener(new PluginListener() {
        public void pluginStarted(PluginEvent e) {
        }

        public void pluginStopped(PluginEvent e) {
            List list = pluginRegistry.getPlugins(Generator.class);

            if (list.size() == 0) {
                startTutorial.putValue("TutorialStarted", Boolean.FALSE);
            }
        }
    });

    final SmallButton stopButton = new SmallButton(stopTutorial);

    final JToolBar tutorialToolbar = new JToolBar();
    tutorialToolbar.setFloatable(false);
    tutorialToolbar.add(startButton);
    tutorialToolbar.add(stopButton);
    container.add(tutorialToolbar, BorderLayout.NORTH);
    tutorialArea.addHyperlinkListener(new HyperlinkListener() {
        public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                if (e.getDescription().equals("StartTutorial")) {
                    startTutorial.actionPerformed(null);
                } else if (e.getDescription().equals("StopTutorial")) {
                    stopTutorial.actionPerformed(null);
                } else {
                    try {
                        tutorialArea.setPage(e.getURL());
                    } catch (IOException e1) {
                        MessageCenter.getInstance().getLogger()
                                .error("Failed to change the URL for the Tutorial", e1);
                    }
                }
            }
        }
    });

    /**
     * loads the saved tab settings and if there are hidden tabs,
     * hide those tabs out of currently loaded tabs..
     */

    if (!getTabbedPane().tabSetting.isWelcome()) {
        displayPanel(ChainsawTabbedPane.WELCOME_TAB, false);
    }
    if (!getTabbedPane().tabSetting.isZeroconf()) {
        displayPanel(ChainsawTabbedPane.ZEROCONF, false);
    }
    tbms.stateChange();

}