1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
package Essaie;
import com.sdz.essaie1.Cadre1;
public class AppliIHM
{
public static void main(String[] args)
{
Cadre1 fenetre=new Cadre1();
fenetre.setVisible(true);
}
}
package Essaie;
import java.awt.*;
public class Cadre1 extends Frame
{
Button button1=new Button();
Label label1=new Label();
CheckboxGroup checkboxGroup1=new CheckboxGroup();
Checkbox checkbox1=new Checkbox();
Checkbox checkbox2=new Checkbox();
Checkbox checkbox3=new Checkbox();
TextField textField1=new TextField();
public Cadre1()
{
}
private void Initialiser()
{
this.setResizable(false);
this.setLayout(null);
this.setBackground(Color.yellow);
this.setSize(348,253);
this.setTitle("Bonjour-Filière C.C.Informatique");
this.setForeground(Color.black);
button1.setBounds(70,200,200,30);
button1.setLabel("Validez votre entrée!");
label1.setBounds(24,115,50,23);
label1.setText("Entrez:");
checkbox1.setBounds(20,25,88,23);
checkbox1.setCheckboxGroup(checkboxGroup1);
checkbox1.setLabel("Madame");
checkbox2.setBounds(20,25,108,23);
checkbox2.setCheckboxGroup(checkboxGroup1);
checkbox2.setLabel("Madmoiselle");
checkbox3.setBounds(20,85,88,23);
checkbox3.setCheckboxGroup(checkboxGroup1);
checkbox3.setLabel("Monsieur");
checkboxGroup1.setSelectedCheckbox(checkbox1);
textField1.setBackground(Color.white);
textField1.setBounds(82,115,198,23);
textField1.setText("Votre nom?");
this.add(checkbox1,null);
this.add(checkbox2,null);
this.add(checkbox3,null);
this.add(button1,null);
this.add(textField1,null);
this.add(label1,null);
}
} |
Partager