public void showTestWindow() {
        boolean cancel = false;
        do {
            try {
                String response = JOptionPane.showInputDialog(ChiSquaredPopup.this, "How many degrees of freedom?", "Enter a number.", JOptionPane.QUESTION_MESSAGE);
                if (response == null) {
                    return;
                }
                degreesOfFreedom = Integer.parseInt(response);
                if (degreesOfFreedom <= 0) {
                    throw new IllegalArgumentException("Degrees of freedom '" + degreesOfFreedom + "' is invalid. Must be 1 or greater!");
                }
            } catch (IllegalArgumentException ex) {
                if (JOptionPane.showConfirmDialog(ChiSquaredPopup.this, "Invalid degrees of freedom!", "Error!", JOptionPane.OK_CANCEL_OPTION) == JOptionPane.CANCEL_OPTION) {
                    cancel = true;
                }
            }
        } while (degreesOfFreedom <= 0 && !cancel);

        if (!cancel) {
            buildWindow();
            setSize(75 * (degreesOfFreedom + 2), 150);
            setTitle("Chi-Squared Test");

            setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/images/GenSim icon large.png")));

            setVisible(true);
        }
    }