CreateMenuForm cmf = new CreateMenuForm(f);
cmf.addWindowListener(this);*/
setVisible(false);
} else if (e.getSource() == runButton) {
TestPlayer player = null;
try {
JFileChooser theChooser1 = new JFileChooser();
int returnVal = theChooser1.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
player = new TestPlayer(theChooser1.getSelectedFile());
player.addWindowListener(this);
setVisible(false);
}
}
catch (Exception ex) {
String outMessage = ex.getMessage();
if (ex instanceof IndexOutOfBoundsException) {
outMessage = "Index out of bounds exception. Check the test file. " + outMessage;
}
if (ex instanceof NullPointerException) {
outMessage = "Null pointer exception. Check the test file. " + outMessage;
}
if (ex instanceof org.xml.sax.SAXException) {
outMessage = "Reading failed: " + outMessage;
}
if (ex instanceof ParserConfigurationException) {
outMessage = "Preparing for reading failed: " + outMessage;
}
if (ex instanceof ClassCastException) {
outMessage = "Class cast failed: " + outMessage;
}
if (ex instanceof TestException) {
outMessage = "Something is wrong with the test: " + outMessage;
}
if (player != null) player.dispose();
requestFocus();
JOptionPane.showMessageDialog(this, outMessage);
}
} else if (e.getSource() == editButton) {