|
Dernière réponse | |
---|---|
Sujet : JAVA et JDialog .... ajouter une image ....... | |
rodocop | Ton code ne compilera pas: la method add attend un argument de type Component et tu lui donnes un type Image (qui herite directement de Object).
BifaceMcLeOD a raison, il faut d'abord creer un JPanel (ou un Panel ou ...). Voici un exemple de sun: class ImagePanel extends JPanel { Image image; public ImagePanel(Image image) { this.image = image; } public void paintComponent(Graphics g) { super.paintComponent(g); //paint background //Draw image at its natural size first. g.drawImage(image, 0, 0, this); } } |
Vue Rapide de la discussion |
---|