JMenu menu = view.getWindowsMenu();
JMenu menu = HiViewerFactory.getWindowsMenu();
    private void attachListeners()    {        JMenu menu = view.getWindowsMenu();        menu.addMenuListener(new MenuListener() {            public void menuSelected(MenuEvent e) { createWindowsMenuItems(); }                        /**              * Required by I/F but not actually needed in our case,              * no op implementation.             * @see MenuListener#menuCanceled(MenuEvent)             */             public void menuCanceled(MenuEvent e) {}            /**              * Required by I/F but not actually needed in our case,              * no op implementation.             * @see MenuListener#menuDeselected(MenuEvent)             */             public void menuDeselected(MenuEvent e) {}                    });                //Listen to keyboard selection        menu.addMenuKeyListener(new MenuKeyListener() {                        public void menuKeyReleased(MenuKeyEvent e)            {                createWindowsMenuItems();            }                        /**              * Required by I/F but not actually needed in our case,              * no op implementation.             * @see MenuKeyListener#menuKeyPressed(MenuKeyEvent)             */            public void menuKeyPressed(MenuKeyEvent e) {}              /**              * Required by I/F but not actually needed in our case,              * no op implementation.             * @see MenuKeyListener#menuKeyTyped(MenuKeyEvent)             */            public void menuKeyTyped(MenuKeyEvent e) {}                    });                view.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);        view.addWindowListener(new WindowAdapter() {            public void windowClosing(WindowEvent e) { model.discard(); }        });     }