在applet中禁用了一些子菜单

时间:2012-07-24 13:17:24

标签: java swing browser applet

我的applet有一个菜单栏和一些子菜单。当我从我的系统浏览器访问applet时,所有子菜单都被启用但是当我从其他机器访问相同的url时,一些子菜单被禁用。 可能是什么问题?

我是否需要对浏览器的设置进行任何更改?

CODE SNIPPET

private void setupMenus() {
        getContentPane().add(mainMenuBar, BorderLayout.NORTH);
        JMenu fileMenu = new JMenu("File");
        fileMenu.setMnemonic('f');
        mainMenuBar.add(fileMenu);
        fileMenu.add(myGenDocViewer.getAction("new_doc")).setMnemonic('n');
        fileMenu.add(myGenDocViewer.getAction("open_doc")).setMnemonic('o');   //Disabled
        fileMenu.addSeparator();
        fileMenu.add(myGenDocViewer.getAction("save_doc")).setMnemonic('s');                fileMenu.add(myGenDocViewer.getAction("save_as")).setMnemonic('a');
        fileMenu.addSeparator();
        fileMenu.add(myGenDocViewer.getAction("export_doc")).setMnemonic('e'); //Disabled

        fileMenu.add(myGenDocViewer.getAction("print")).setMnemonic('p');
        fileMenu.add(myGenDocViewer.getAction("print_all"));
        fileMenu.addSeparator();
        fileMenu.add(myGenDocViewer.getAction("close_doc")).setMnemonic('c');
        fileMenu.add(myGenDocViewer.getAction("close_all_doc")).setMnemonic('l');

        JMenu editMenu = new JMenu("Edit");
        editMenu.setMnemonic('e');
        mainMenuBar.add(editMenu);
        editMenu.add(myGenDocViewer.getAction("undo")).setMnemonic('u');
        editMenu.add(myGenDocViewer.getAction("redo")).setMnemonic('r');
        editMenu.addSeparator();
        editMenu.add(myGenDocViewer.getAction("cut")).setMnemonic('t');
        editMenu.add(myGenDocViewer.getAction("copy")).setMnemonic('c');
        editMenu.add(myGenDocViewer.getAction("paste")).setMnemonic('p');
        editMenu.add(myGenDocViewer.getAction("delete")).setMnemonic('d');
        editMenu.addSeparator();
        editMenu.add(myGenDocViewer.getAction("selectAll")).setMnemonic('s');
        editMenu.add(myGenDocViewer.getAction("deselectAll")).setMnemonic('e');
        editMenu.add(myGenDocViewer.getAction("selectArea")).setMnemonic('a');
        editMenu.addSeparator();
        editMenu.add(myGenDocViewer.getAction("preferences")).setMnemonic('f');

        JMenu viewMenu = new JMenu("View");
        viewMenu.setMnemonic('v');
        mainMenuBar.add(viewMenu);
        viewMenu.add(myGenDocViewer.getAction("page_first")).setMnemonic('f');
        viewMenu.add(myGenDocViewer.getAction("page_prev")).setMnemonic('p');
        viewMenu.add(myGenDocViewer.getAction("page_next")).setMnemonic('n');
        viewMenu.add(myGenDocViewer.getAction("page_last")).setMnemonic('l');
        viewMenu.add(myGenDocViewer.getAction("goto_page")).setMnemonic('g');
        viewMenu.addSeparator();
        viewMenu.add(myGenDocViewer.getAction("doc_first")).setMnemonic('i');
        viewMenu.add(myGenDocViewer.getAction("doc_prev")).setMnemonic('r');
        viewMenu.add(myGenDocViewer.getAction("doc_next")).setMnemonic('e');
        viewMenu.add(myGenDocViewer.getAction("doc_last")).setMnemonic('s');
        viewMenu.addSeparator();
        viewMenu.add(myGenDocViewer.getAction("showhidethumb")).setMnemonic('b');
        viewMenu.add(myGenDocViewer.getAction("hide_show")).setMnemonic('a');

        JMenu imageMenu = new JMenu("Image");
        imageMenu.setMnemonic('i');
        mainMenuBar.add(imageMenu);
        imageMenu.add(myGenDocViewer.getAction("enhance")).setMnemonic('e');
        imageMenu.add(myGenDocViewer.getAction("invert")).setMnemonic('v');
        imageMenu.addSeparator();
        imageMenu.add(myGenDocViewer.getAction("zoom_in")).setMnemonic('i');
        imageMenu.add(myGenDocViewer.getAction("zoom_out")).setMnemonic('o');
        imageMenu.add(myGenDocViewer.getAction("zoom_custom")).setMnemonic('z');
        imageMenu.addSeparator();
        imageMenu.add(myGenDocViewer.getAction("fit_height")).setMnemonic('h');
        imageMenu.add(myGenDocViewer.getAction("fit_width")).setMnemonic('w');
        imageMenu.add(myGenDocViewer.getAction("fit_window")).setMnemonic('o');
        imageMenu.add(myGenDocViewer.getAction("fit_actualsize")).setMnemonic('a');
        imageMenu.addSeparator();
        imageMenu.add(myGenDocViewer.getAction("rotate_90")).setMnemonic('r');
        imageMenu.add(myGenDocViewer.getAction("rotate_180")).setMnemonic('8');
        imageMenu.add(myGenDocViewer.getAction("rotate_270")).setMnemonic('l');
        imageMenu.add(myGenDocViewer.getAction("rotate_pages")).setMnemonic('p');

        JMenu annotationMenu = new JMenu("Annotation");
        annotationMenu.setMnemonic('a');
        mainMenuBar.add(annotationMenu);
        annotationMenu.add(myGenDocViewer.getAction("Arrow")).setMnemonic('a');
        annotationMenu.add(myGenDocViewer.getAction("Circle")).setMnemonic('c');
        annotationMenu.add(myGenDocViewer.getAction("Highlight")).setMnemonic('h');
        annotationMenu.add(myGenDocViewer.getAction("Line")).setMnemonic('l');
        annotationMenu.add(myGenDocViewer.getAction("Note")).setMnemonic('n');
        annotationMenu.add(myGenDocViewer.getAction("Pen")).setMnemonic('p');
        annotationMenu.add(myGenDocViewer.getAction("Rect")).setMnemonic('r');
        annotationMenu.add(myGenDocViewer.getAction("Stamp")).setMnemonic('s');
        annotationMenu.add(myGenDocViewer.getAction("Text")).setMnemonic('t');
        annotationMenu.addSeparator();
        annotationMenu.add(myGenDocViewer.getAction("eraser")).setMnemonic('e');
        annotationMenu.add(myGenDocViewer.getAction("move_front")).setMnemonic('f');
        annotationMenu.add(myGenDocViewer.getAction("send_back")).setMnemonic('b');
        annotationMenu.add(myGenDocViewer.getAction("properties")).setMnemonic('o');
    }

我正在使用TViewerApplet.java(它扩展了JApplet)http://publib.boulder.ibm.com/infocenter/cmgmt/v8r4m0/index.jsp?topic=%2Fcom.ibm.samples.doc%2Fsamples%2Fjava%2Fviewer%2Freadme.html

浏览器信息::我正在使用Internet Explorer 8

jdk版本:jdk1.6

0 个答案:

没有答案