Test d'affichage PDF

-> Fonctionnel (voir PDFTest.java)
This commit is contained in:
LucasV-IUT
2021-11-28 00:33:17 +01:00
parent c77b21a384
commit e86d3f41b3
18 changed files with 74 additions and 188 deletions
+33
View File
@@ -0,0 +1,33 @@
package lecteur_pdf.document;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
class PDFTest {
/**
* TODO comment main
*
* @param args
*/
public static void main(String[] args) throws IOException {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setSize(300,300);
frame.setBackground(Color.gray);
frame.setVisible(true);
PDF doc = new PDF(new File("F:/test_pdf1.pdf"));
JScrollPane scrollPane = new JScrollPane(doc);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
frame.getContentPane().add(scrollPane);
}
}