JMenuItem recentOption = createMenuItem(name, null, null); recentOption.setActionCommand("_open" + i); recentMenu.add(recentOption);
recentMenu.add(new TMenuItem(new OpenRecentAction(this, saveAction, name, i)));
    public void updateRecent(String filename) {        // If a filename is given, add it to the recent files        if (filename != null) {            TiledConfiguration.addToRecentFiles(filename);        }        java.util.List files = TiledConfiguration.getRecentFiles();        recentMenu.removeAll();        for (int i = 0; i < files.size(); i++) {            String path = (String) files.get(i);            String name =                path.substring(path.lastIndexOf(File.separatorChar) + 1);            JMenuItem recentOption = createMenuItem(name, null, null);            recentOption.setActionCommand("_open" + i);            recentMenu.add(recentOption);        }    }