final JCheckBoxMenuItem keepOnTop = new JCheckBoxMenuItem("Keep on Top"); keepOnTop.setEnabled(false); viewMenu.add(keepOnTop);
    private void initViewMenu() {                JMenu viewMenu = new JMenu("View");        if (frame == null) viewMenu.setEnabled(false);                JMenuItem halfsize = new JMenuItem("Half Size");        halfsize.setAccelerator(KeyStroke.getKeyStroke('0', menuShortcutKeyMask));        halfsize.addActionListener(new SizeListener(frame, 0.5));        viewMenu.add(halfsize);                JMenuItem fullsize = new JMenuItem("Full Size");        fullsize.setAccelerator(KeyStroke.getKeyStroke('1', menuShortcutKeyMask));        fullsize.addActionListener(new SizeListener(frame, 1.0));        viewMenu.add(fullsize);                JMenuItem doublesize = new JMenuItem("Double Size");        doublesize.setAccelerator(KeyStroke.getKeyStroke('2', menuShortcutKeyMask));        doublesize.addActionListener(new SizeListener(frame, 2.0));        viewMenu.add(doublesize);                JMenuItem triplesize = new JMenuItem("Triple Size");        triplesize.setAccelerator(KeyStroke.getKeyStroke('3', menuShortcutKeyMask));        triplesize.addActionListener(new SizeListener(frame, 3.0));        viewMenu.add(triplesize);                JMenuItem quadrupleSize = new JMenuItem("Quadruple Size");        quadrupleSize.setAccelerator(KeyStroke.getKeyStroke('4', menuShortcutKeyMask));        quadrupleSize.addActionListener(new SizeListener(frame, 4.0));        viewMenu.add(quadrupleSize);                JMenuItem fullScreen = new JMenuItem("Full Screen");        fullScreen.setAccelerator(KeyStroke.getKeyStroke('F', menuShortcutKeyMask));        fullScreen.addActionListener(new FullScreenListener(frame));        viewMenu.add(fullScreen);                viewMenu.addSeparator();                viewMenu.add(new PresentMovieAction(frame));                viewMenu.addSeparator();                JMenuItem loop = new JCheckBoxMenuItem("Loop");        loop.setAccelerator(KeyStroke.getKeyStroke('L', menuShortcutKeyMask));                loop.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent event) {                MovieController controller = frame.getController();                try {                   if (controller.getLooping()) controller.setLooping(false);                   else controller.setLooping(true);                }                catch (StdQTException e) {                    // ???? Auto-generated catch block                    e.printStackTrace();                }            }});        viewMenu.add(loop);                JMenuItem loopBackAndForth = new JCheckBoxMenuItem("Loop Back and Forth");        loopBackAndForth.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent event) {                MovieController controller = frame.getController();                try {                    if (controller.getLoopIsPalindrome()) controller.setLoopIsPalindrome(false);                    else controller.setLoopIsPalindrome(true);                }                catch (StdQTException e) {                    // ???? Auto-generated catch block                    e.printStackTrace();                }            }});        viewMenu.add(loopBackAndForth);                final JCheckBoxMenuItem playSelectionOnly = new JCheckBoxMenuItem("Play Selection Only");        playSelectionOnly.setAccelerator(KeyStroke.getKeyStroke('T', menuShortcutKeyMask));        playSelectionOnly.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent event) {                try {                   MovieController controller = frame.getController();                    if (playSelectionOnly.isSelected()) {                        controller.setPlaySelection(true);                    }                    else {                       controller.setPlaySelection(false);                    }                }                catch (QTException ex) {                    ex.printStackTrace();                }            }        });                viewMenu.add(playSelectionOnly);                final JCheckBoxMenuItem playAllFrames = new JCheckBoxMenuItem("Play All Frames");        playAllFrames.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent event) {                MovieController controller = frame.getController();                try {                    if (playAllFrames.isSelected()) {                        // Setting this mutes the sound. This appears to be the normal                        // and expected behavior. See http://lists.apple.com/archives/quicktime-users/2003/Dec/msg00061.html                        controller.setPlayEveryFrame(true);                    }                    else {                        controller.setPlayEveryFrame(false);                    }                }                catch (QTException ex) {                    ex.printStackTrace();                }            }                        });        viewMenu.add(playAllFrames);        viewMenu.addSeparator();        viewMenu.add(new PlayAllMoviesAction());        viewMenu.addSeparator();        viewMenu.add(new GoToPosterFrameAction(frame));        viewMenu.add(new SetPosterFrameAction(frame));        viewMenu.addSeparator();        JMenuItem chooseLanguage = new JMenuItem("Choose Language...");        chooseLanguage.setEnabled(false);        viewMenu.add(chooseLanguage);        add(viewMenu);    }