我的小程序有一个菜单栏和一些子菜单。当我从系统浏览器访问小程序时,所有子菜单都已启用,但是当我从其他机器访问相同的 url 时,某些子菜单被禁用。可能是什么问题?
我需要对浏览器的设置进行任何更改吗?
代码片段
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