I can not see any of my component why ?
Here is all the code, I forget something but I do not remember what
Code:import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; public class mainInterface extends JApplet { JFrame frame = new JFrame(); JLabel lbl_titre = new JLabel(); JLabel lbl_prenom = new JLabel(); JLabel lbl_nom = new JLabel(); JLabel lbl_pays = new JLabel(); JLabel lbl_adresse = new JLabel(); JLabel lbl_numero = new JLabel(); //Initialize the applet public void init() {} public mainInterface() { JApplet applet = new mainInterface(); frame.setTitle("Applet Frame"); frame.setContentPane(applet.getContentPane()); frame.setLayout (null); //applet.init(); applet.start(); frame.setSize(400,320); initComponent(); frame.setVisible(true); } //End constructor : mainInterface //Main method public static void main(String args[]) { mainInterface goGo = new mainInterface(); }//End Main public void initComponent() { //Ajout du texte lbl_titre.setText ("Donation Internationale"); lbl_prenom.setText ("Prenom:"); lbl_nom.setText ("Nom:"); lbl_pays.setText ("Pays:"); lbl_adresse.setText ("Adresse:"); lbl_numero.setText ("Numero de carte de crédit:"); //Positionnement lbl_titre.setBounds (10,10,200,25); lbl_prenom.setBounds (10,35,40,25); lbl_nom.setBounds (10,60,40,25); lbl_pays.setBounds (10,85,40,25); lbl_adresse.setBounds (10,110,40,25); lbl_numero.setBounds (10,135,40,25); //Ajout dans le frame frame.add (lbl_titre); frame.add (lbl_prenom); frame.add (lbl_nom); frame.add (lbl_pays); frame.add (lbl_adresse); frame.add (lbl_numero); }//End initComponent }//End class : mainInterface





Reply With Quote