Bonjour,
Dans ma JApplet j'affiche une image avec ce code:
Mon problème est que si je souhaite afficher un TIF mon code ne marche plus. Quelqu'un sait ce qu'il faut faire pour que je puisse afficher mon image TIFF avec les scroll?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 ImageIcon imageIcon = new ImageIcon("C:\\Documents and Settings\\roxor972\\Bureau\\15358000.jpeg"); ImageIcon imageResized = new ImageIcon(imageIcon.getImage().getScaledInstance((int)this.viewWidth,(int) this.viewHeight, Image.SCALE_SMOOTH)); ScrollablePicture picture = new ScrollablePicture(imageResized, 10); JScrollPane pictureScrollPane = new JScrollPane(picture); pictureScrollPane.setPreferredSize(new Dimension(420, 550)); pictureScrollPane.setVisible(true); this.getContentPane().add(pictureScrollPane);
Merci d'avance
Partager