if (maps == null) return;
for (int j=0; j<maps.length; j++) {
// adds menuItem for map
String label = maps[j].getName();
if (label.length() >= 4) label = label.substring(0, label.length()-4);
JMenuItem menuItem = new BSMapMenuItem(label, maps[j].getName(), dirs[i].getName());
menuItem.addActionListener( new ActionListener() {
public void actionPerformed(ActionEvent e) {
loadMapForItem((BSMapMenuItem)e.getSource());
}
});
submenu.add(menuItem);