developvbdebut
Messages postés476Date d'inscriptionsamedi 14 août 2004StatutMembreDernière intervention 2 juin 2012
-
11 avril 2006 à 09:00
Twinuts
Messages postés5375Date d'inscriptiondimanche 4 mai 2003StatutModérateurDernière intervention14 juin 2023
-
11 avril 2006 à 13:15
Bonjour tout le monde
J'ai du mal à inserer image des que je mai /.
Car je souhaiterai mettre tout mes image dans un dossier et indiquer le chemin pour l'insertion.
public class ElementParam extends Panel implements ActionListener
{
int cinpc, dixc, vingtc, cinquc, uneurro;
public ElementParam(Monnayeur m)
{
Label cinp = new Label("5 centimes");
TextField cinpc = new TextField(10);
cinpc.addActionListener(new Stockpiece(5,m));
this.add(cinpc);
Label dix = new Label("10 centimes");
TextField dixc = new TextField(10);
dixc.addActionListener(new Stockpiece(4,m));
this.add(dixc);
Label vingt = new Label("20 centimes");
TextField vingtc = new TextField(10);
vingtc.addActionListener(new Stockpiece(3,m));
this.add(vingtc);
Label cinquante = new Label("50 centimes");
TextField cinquc = new TextField(10);
cinquc.addActionListener(new Stockpiece(2,m));
this.add(cinquc);
Label un = new Label("1 euro");
TextField uneurro = new TextField(10);
uneurro.addActionListener(new Stockpiece(1,m));
this.add(uneurro);
Button valide = new Button("Valider");
valide.addActionListener(this);
Image quit=getImage(getDocumentBase(),"machine_a_cafe/image/fermerparam.JPEG");
Label bquit = new Label(new ImageIcon(quit));
}
}
Voici les erreur maintenant
ElementParam.java:52: cannot find symbol
symbol : method getDocumentBase()
location: class ElementParam
Image quit=getImage(getDocumentBase(),"machine_a_cafe/image/fermerparam.JPEG");
^
ElementParam.java:53: cannot find symbol
symbol : class ImageIcon
location: class ElementParam
Label bquit = new Label(new ImageIcon(quit));
^
ElementParam.java:58: cannot find symbol
symbol : constructor Label(javax.swing.ImageIcon)
location: class java.awt.Label
Label quit = new Label(new ImageIcon("machine_a_cafe/image/fermerparam.JPEG"));