private void writeErrorMessageToPanel(JPanel panel) {
        panel.setLayout(new GridLayout(5, 1));
        JLabel message1 = new JLabel("One of the simulation threads were interrupted.");
        JLabel message2 = new JLabel("Please try again.");
        JLabel message3 = new JLabel("If the problem persists, try using only one thread.");
        panel.add(message1);
        panel.add(message2);
        panel.add(new JLabel(""));
        panel.add(message3);
    }