Flashcards in Java

Written By: James Williams

- 10 Apr 2006 -
















Description: By using Java and XML, this tutorial walks you through creating flashcards for learning French.

  1. Introduction
  2. The User Interface
  3. ActionListener/MouseListeners
  4. Loading the Word List

Introduction

If you aren't already familiar with the JDOM XML APIs, it might be a good time to look at my primer on JDOM.

In addition to Computer Science, the French language is also a love of mine. Having studied for a number of years now, my main goal, as is that of most language students, is to increase and retain vocabulary. Carrying around hundreds of index cards is not only cumbersome but is so 90's. We are going to develop a flashcard system and a helper application to create the flashcard files.

The flashcard format

In designing the format, I decided to include fields for foreign and native(mother tongue) translations. One of my French teachers from way back always suggested a monolingual dictionary because it has more words and if you don't understand a word in the definition, you'll have to look that one up too, and so on and so one. The file will also have fields for the list name and the actual word, both as attributes of the title and entry nodes, respectively. Below is an example of a valid file:

>
         name="verbs">
         word="parler">
                >Prononcer des mots, articuler.>
                >v. to speak>
        >
         word="saisir">
                >Prendre, attraper vivement.>
                >v. to seize, take control of>
        >
>

Next >>