Good day everybody,
I am currently working on a small Java program using Swing , in which scanned documents are to be displayed as a preview.
For images (jpg, png, tif), this works perfectly with JLabel and ImageIcon.
Now I also wanted to display PDF files directly in the program .
I tried using ICEpdf and copied an example from the internet. Unfortunately, integrating the libraries seems to be somewhat complicated, and I'm encountering some classpath or dependency problems .
My question would therefore be:
Is there an easier way to display a PDF in a Java Swing application?
For example with
If anyone has a simple example class or a recommendation for a suitable library, I would be very grateful.
Thank you so much! 😊
I am currently working on a small Java program using Swing , in which scanned documents are to be displayed as a preview.
For images (jpg, png, tif), this works perfectly with JLabel and ImageIcon.
Now I also wanted to display PDF files directly in the program .
I tried using ICEpdf and copied an example from the internet. Unfortunately, integrating the libraries seems to be somewhat complicated, and I'm encountering some classpath or dependency problems .
My question would therefore be:
Is there an easier way to display a PDF in a Java Swing application?
For example with
- JEditorPane
- JTextPane
- or another simple library?
If anyone has a simple example class or a recommendation for a suitable library, I would be very grateful.
Thank you so much! 😊