sample.chm
当用户单击帮助菜单项时,我正在尝试打开文件。我正在使用 NetBeans 7.01。我的类文件和帮助文件夹都在:
NetBeansProjects\MyApplication\src\org\me\myapplication
这是代码:
private void helpContentsActionPerformed(java.awt.event.ActionEvent evt) {
File f = new File("/help/sample.chm");
try {
Desktop.getDesktop().open(f);
} catch (Exception ex) {
System.out.println(ex);
}
}
错误:
java.lang.IllegalArgumentException: The file: \help\sample.chm doesn't exist.