private JMenuItem getPatternLengthItem() {
		if (patternLengthItem == null) {
			patternLengthItem = new JMenuItem();
			patternLengthItem.setText("Set Pattern Length...");
			patternLengthItem.setMnemonic(KeyEvent.VK_L);
			patternLengthItem.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					MonomeConfiguration monomeConfig = MonomeConfigurationFactory.getMonomeConfiguration(index);
					if (monomeConfig.pages.size() > 0) {
						int curLength = monomeConfig.patternBanks.get(monomeConfig.curPage).getPatternLength();
						String length = (String)JOptionPane.showInputDialog(
								(JMenuItem) e.getSource(),
								"Enter new pattern length (1-16 measures)",
								"Set Pattern Length",
								JOptionPane.PLAIN_MESSAGE,
								null,
								null,
								curLength);
						if (length == null || length.compareTo("") == 0) {
							return;
						}
						try {
							int iLength = Integer.parseInt(length);
							if (iLength > 0 && iLength <= 16) {
								monomeConfig.setPatternLength(monomeConfig.curPage, iLength);
							}
						} catch (NumberFormatException ex) {
							return;
						}
					}				
				}
			});
		}
		return patternLengthItem;
	}