mirror of
https://github.com/LucasVbr/LecteurPdfDoubleAffichage.git
synced 2026-05-14 01:21:50 +00:00
Test d'affichage PDF
-> Fonctionnel (voir PDFTest.java)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user