嗨,伙计们,我正在尝试使用此代码在 JFrame 中显示一个 excel 工作表页面
JFrame frame = new JFrame();
Container cp = frame.getContentPane();
cp.setLayout(new BorderLayout());
File workbookFile = new File("C:\\Workbook.xls");
//Opening the specified file in the JWorkbook component
JWorkbook jWorkbook = new JWorkbook(workbookFile);
cp.add(jWorkbook);
但我收到错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/jniwrapper/win32/automation/OleContainer
at excel.open.ExcelOpen.main(ExcelOpen.java:29)
Caused by: java.lang.ClassNotFoundException: com.jniwrapper.win32.automation.OleContainer
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 1 more
Java Result: 1
我的 ClassPath 中有以下 Jar:jexcel-1.5.23878.jar。请帮忙。