[Composant] JButton texturé
Bonjour,
Je souhaiterais faire un Jbutton texturé.
Après divers test, cela ne fonctionnait pas, donc j'ai été cherché sur le net, et j'ai trouvé une solution qui est censée fonctionner, mais qui ne fonctionne pas chez moi, et je ne vois pas pourquoi....
Code:
1 2 3 4 5 6 7 8 9 10
|
File fi = new File("bg.gif");
if(fi.exists())
System.out.println("Existe image");
ImageIcon img = new ImageIcon(fi.getAbsolutePath());
JButton bbg = new JButton(label,img);
bbg.setBounds(x, y, width, height);
panel.add(bbg);
frame.add(panel);
frame.setVisible(true); |
Cela me crée un bouton texturé, mais avec la texture java de base .....