[debutant] ajouter ImageIcon dans un Jbutton
bonjour
Pour mettre une ImageIcon dans un Jbutton je fais
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| public class Jeton extends JButton {
int abs;
int ord;
int num;
ImageIcon image;
public Jeton(int abs, int ord, int num) {
super(new ImageIcon("photo" + num));
this.abs = abs;
this.ord = ord;
this.num = num;
repaint();
} |
mais ca ne marche pas.
de plus j ai un champs image et j aimerai que le champ image l ImageIcon en question.
a mon avis image = new ImageIcon("photo" + num) ne suffit pas merci.