简体   繁体   中英

Java - Open a PDF file from within the JAR in a Java window (JPanel, JFrame)

I have a Java desktop application (a jar that will be used in a Mac OS .app and a Windows .exe). This Jar will contain a PDF file and I need to show this file in a Java Swing window. How is this possible? Can be done without any additional library, like ICEPdf?

使用此功能,您将使用操作系统已安装的默认PDF查看器

Desktop.getDesktop().open(new File(*path to PDF*));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM