quizName = quizBaseName + "." + quizExt;
manager.setQuizData(quizName,"");
quizList.setListData(manager.getQuizNames());
QuizEditThread editThread = new QuizEditThread(quizName);
editThread.start();
}
});
deleteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//System.out.println("Delete");
if (! manager.removeQuiz(getSelectedQuizName())) {
//System.out.println("Error removing " + quizName);
}
else {
//System.out.println("Removed " + quizName);
}
quizList.setListData(manager.getQuizNames());
}
});
editButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
//System.out.println("Edit");
// TODO Change this to a password field
String password = JOptionPane.showInputDialog(mainPane,"Enter Password","Protected Area",
JOptionPane.QUESTION_MESSAGE);
if (password != null && password.equals("nocheating")) {
QuizEditThread editThread = new QuizEditThread();
editThread.start();
}
}
});