Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
public class QuizCardPlayer { public void go() { // build and display gui } class NextCardListener implements ActionListener { public void actionPerformed(ActionEvent ev) { // if this is a question, show the answer, otherwise show next question // set a flag for whether we're viewing a question or answer } } class OpenMenuListener implements ActionListener { public void actionPerformed(ActionEvent ev) { // bring up a file dialog box // let the user navigate to and choose a card set to open } } private void loadFile(File file) { // must build an ArrayList of cards, by reading them from a text file // called from the OpenMenuListener event handler, reads the file one line at a time