for (int frameNum=0; frameNum < pictureFrames.length; frameNum++) {
final PictureFrame pictureFrame = (PictureFrame)pictureFrames[frameNum];
JCheckBoxMenuItem windowMenuItem = new JCheckBoxMenuItem("" + (frameNum + 1) + " " + pictureFrame.getTitle());
windowMenuItem.setSelected(pictureFrame.isSelected());
windowMenuItem.setMnemonic((char)(0x30 + frameNum));
windowMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// If a window is selected from the menu, switch to that window.
try {
pictureFrame.setSelected(true);
} catch (PropertyVetoException e1) {