Modification du code des Popup + Ajout disposition Verticale et Horizontale

This commit is contained in:
LucasV-IUT
2021-12-07 21:41:26 +01:00
parent 7987a7958c
commit 49f3a1fa00
4 changed files with 197 additions and 123 deletions
+6 -11
View File
@@ -46,17 +46,12 @@ public class PDF extends JPanel {
* @param fichier Le fichier PDF que lon veut ouvrir
* @throws IllegalArgumentException si le fichier nexiste pas
*/
public PDF(File fichier) throws IOException{
// try {
this.document = PDDocument.load(fichier);
this.pages = new Page[document.getNumberOfPages()];
this.zoom = 1.0f;
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setAlignmentX(Component.CENTER_ALIGNMENT);
// } catch (IOException e) {
// throw new IllegalArgumentException();
// }
public PDF(File fichier, boolean vertical) throws IOException {
document = PDDocument.load(fichier);
pages = new Page[document.getNumberOfPages()];
zoom = 1.0f;
setAlignmentX(Component.CENTER_ALIGNMENT);
if (vertical) setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
}
/**