public void loadMenuItem(String filename)
    {
        Scanner scan = null;
        
        try
        {
            scan = new Scanner(getClass().getResourceAsStream(filename), "UTF-8");
            
            // Use first line of file as the menu item name.
            init(scan.nextLine(), null);
            
            while (true)
            {
                if (!scan.hasNext())
                    break;
                
                // Read a character from the file.
                String type = scan.next();
                String hira = scan.next();
                String kata = scan.next();
                String roma = scan.next();
                String sound = scan.next();
                
                // Parse dakuten/youon flags.
                int index;
                if (type.equals("n"))
                    index = NORMAL;
                else if (type.equals("d"))
                    index = DAKUTEN;
                else if (type.equals("y"))
                    index = YOUON;
                else if (type.equals("dy"))
                    index = BOTH;
                else
                {
                    System.err.println("Can't parse type \"" + type + "\" in file " + filename);
                    continue;
                }
                
                // Populate decks with new cards.
                hiraToSound[index].addCard(new Card("Read this hiragana", hira, null, roma, sound));
                hiraToSound[index].addCard(new Card("Write in hiragana", roma, sound, hira, sound));
                kataToSound[index].addCard(new Card("Read this katakana", kata, null, roma, sound));
                kataToSound[index].addCard(new Card("Write in katakana", roma, sound, kata, sound));
                hiraToKata[index].addCard(new Card("Write in katakana", hira, null, kata, sound));
                hiraToKata[index].addCard(new Card("Write in hiragana", kata, null, hira, sound));
            }
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        finally
        {
            if (scan != null)
                scan.close();
        }
    }