kifouillou
Messages postés
170
Date d'inscription
mardi 27 septembre 2005
Statut
Membre
Dernière intervention
28 janvier 2011
19 janv. 2007 à 11:14
package example;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
public class Test_SWT {
private Shell sShell; // @jve:decl-index=0:visual-constraint="10,10"
private Composite composite ;
private Composite composite1 ;
private Composite composite2;
private Composite composite3;
private Menu menuBar = null;
private Menu submenu = null;
private Menu submenu1 = null;
public Test_SWT(){
Display display = Display.getDefault();
createSShell();
sShell.open();
while (!sShell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep(); }
display.dispose();
}
private void createSShell() {
sShell = new Shell();
sShell.setText("Rendez-vous");
sShell.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
sShell.setSize(new Point(584, 538));
menuBar = new Menu(sShell, SWT.BAR);
MenuItem submenuItem = new MenuItem(menuBar, SWT.CASCADE);
submenuItem.setText("fichier");
MenuItem submenuItem1 = new MenuItem(menuBar, SWT.CASCADE);
submenuItem1.setText("aide");
submenu1 = new Menu(submenuItem1);
submenuItem1.setMenu(submenu1);
submenu = new Menu(submenuItem);
submenuItem.setMenu(submenu);
sShell.setMenuBar(menuBar);
Menu menuFichier = new Menu( sShell, SWT.DROP_DOWN );
submenuItem.setMenu(menuFichier);
MenuItem open = new MenuItem( menuFichier, SWT.PUSH );
open.setText("Ouvrir");
MenuItem enregistrer = new MenuItem( menuFichier, SWT.PUSH );
enregistrer.setText("enregistrer");
MenuItem envoyer = new MenuItem( menuFichier, SWT.PUSH );
envoyer.setText("envoyer");
MenuItem quitter = new MenuItem( menuFichier, SWT.PUSH );
quitter.setText("quitter");
Menu menuAide = new Menu(sShell, SWT.DROP_DOWN);
submenuItem1.setMenu(menuAide);
MenuItem sorry = new MenuItem( menuAide, SWT.PUSH );
sorry.setText("A propos");
TabFolder tabFolder = new TabFolder(sShell, SWT.NONE);
tabFolder.setBounds(new Rectangle(1, 0, 311, 19));
tabFolder.setSize(584,600);
composite = new Composite(tabFolder, SWT.NONE);
composite1 = new Composite(tabFolder, SWT.NONE);
composite2 = new Composite(tabFolder, SWT.NONE);
composite3 = new Composite(tabFolder, SWT.NONE);
TabItem onglet1 = new TabItem(tabFolder, SWT.NONE);
onglet1.setText("Date");
TabItem onglet2 = new TabItem(tabFolder, SWT.NONE);
onglet2.setText("Bilan");
TabItem onglet3 = new TabItem(tabFolder, SWT.NONE);
onglet3.setText("Produits et services utilisés");
TabItem onglet4 = new TabItem(tabFolder, SWT.NONE);
onglet4.setText("Action de suivi");
onglet1.setControl(composite);
Label label = new Label(composite, SWT.CENTER);
label.setBounds(new Rectangle(15, 46, 121, 19));
label.setText("Date du rendez-vous : ");
Label label1 = new Label(composite, SWT.CENTER);
label1.setBounds(new Rectangle(15, 95, 124, 19));
label1.setText("Durée du rendez-vous :");
Label label2 = new Label(composite, SWT.CENTER);
label2.setBounds(new Rectangle(16, 140, 84, 21));
label2.setText("Interlocuteur :");
Text text = new Text(composite, SWT.BORDER);
text.setBounds(new Rectangle(178, 44, 139, 20));
Text text1 = new Text(composite, SWT.BORDER);
text1.setBounds(new Rectangle(179, 94, 139, 20));
Text text2 = new Text(composite, SWT.BORDER);
text2.setBounds(new Rectangle(179, 140, 140, 21));
Label label3 = new Label(composite, SWT.CENTER);
label3.setBounds(new Rectangle(17, 191, 144, 20));
label3.setText("Fonctions de l'interlocuteur :");
Text text3 = new Text(composite, SWT.BORDER);
text3.setBounds(new Rectangle(179, 191, 140, 20));
Text textArea = new Text(composite, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
textArea.setBounds(new Rectangle(330, 64, 191, 147));
Label label4 = new Label(composite, SWT.CENTER);
label4.setBounds(new Rectangle(350, 30, 128, 18));
label4.setText("Objectifs personnalisés : ");
onglet2.setControl(composite1);
Table a = new Table(composite1, SWT.NONE);
a.setHeaderVisible(true);
a.setLinesVisible(true);
a.setBounds(new Rectangle(180, 29, 374, 163));
Label qa = new Label(composite1, SWT.CENTER);
qa.setBounds(new Rectangle(5, 211, 98, 20));
qa.setText("Commentaires :");
Label aq = new Label(composite1, SWT.CENTER);
aq.setBounds(new Rectangle(7, 29, 92, 18));
aq.setText("Réactions client : ");
Text xs = new Text(composite1, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
xs.setBounds(new Rectangle(183, 203, 372, 65));
Label wx = new Label(composite1, SWT.CENTER);
wx.setBounds(new Rectangle(5, 286, 126, 18));
wx.setText("Résultat(s) / objectif(s) : ");
Text cx = new Text(composite1, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
cx.setBounds(new Rectangle(184, 279, 377, 54));
Label fvc = new Label(composite1, SWT.CENTER);
fvc.setBounds(new Rectangle(3, 348, 171, 18));
fvc.setText("Produits et services mis en avant : ");
Button jn = new Button(composite1, SWT.CHECK);
jn.setBounds(new Rectangle(13, 376, 17, 18));
Label cv = new Label(composite1, SWT.CENTER);
cv.setBounds(new Rectangle(44, 376, 52, 19));
cv.setText("Atelier(s)");
Button de = new Button(composite1, SWT.CHECK);
de.setBounds(new Rectangle(13, 406, 19, 17));
Label wq = new Label(composite1, SWT.CENTER);
wq.setBounds(new Rectangle(44, 405, 104, 17));
wq.setText("Démarche sécurité :");
Button ww = new Button(composite1, SWT.CHECK);
ww.setBounds(new Rectangle(180, 406, 17, 15));
Button xx = new Button(composite1, SWT.CHECK);
xx.setBounds(new Rectangle(255, 406, 16, 16));
Label sdf = new Label(composite1, SWT.CENTER);
sdf.setBounds(new Rectangle(206, 406, 41, 16));
sdf.setText("LHN");
Label tyu = new Label(composite1, SWT.CENTER);
tyu.setBounds(new Rectangle(282, 406, 41, 16));
tyu.setText("LHE");
Button fde = new Button(composite1, SWT.CHECK);
fde.setBounds(new Rectangle(332, 405, 18, 16));
Label chien = new Label(composite1, SWT.CENTER);
chien.setBounds(new Rectangle(359, 405, 40, 17));
chien.setText("Visa");
onglet3.setControl(composite2);
Label hg = new Label(composite2, SWT.CENTER);
hg.setBounds(new Rectangle(8, 29, 57, 17));
hg.setText("Fil Pilote");
Button checkBox = new Button(composite2, SWT.CHECK | SWT.UP);
checkBox.setBounds(new Rectangle(84, 29, 18, 15));
Label mv = new Label(composite2, SWT.CENTER);
mv.setBounds(new Rectangle(110, 31, 29, 14));
mv.setText("oui");
Button checkBox1 = new Button(composite2, SWT.CHECK);
checkBox1.setBounds(new Rectangle(148, 30, 21, 15));
Label yy = new Label(composite2, SWT.CENTER);
yy.setBounds(new Rectangle(174, 30, 29, 16));
yy.setText("non");
Label cLabel = new Label(composite2, SWT.CENTER);
cLabel.setText("Si non, à abonner ?");
cLabel.setBounds(new Rectangle(222, 27, 112, 17));
Button checkBox2 = new Button(composite2, SWT.CHECK);
checkBox2.setBounds(new Rectangle(344, 29, 18, 15));
Label gr = new Label(composite2, SWT.CENTER);
gr.setBounds(new Rectangle(369, 31, 27, 12));
gr.setText("oui");
Button checkBox3 = new Button(composite2, SWT.CHECK);
checkBox3.setBounds(new Rectangle(405, 30, 19, 14));
Label mg = new Label(composite2, SWT.CENTER);
mg.setBounds(new Rectangle(432, 31, 38, 13));
mg.setText("non");
Label label5 = new Label(composite2, SWT.CENTER);
label5.setBounds(new Rectangle(8, 54, 58, 17));
label5.setText("Newsletter");
Button checkBox4 = new Button(composite2, SWT.CHECK);
checkBox4.setBounds(new Rectangle(84, 54, 18, 15));
Label label6 = new Label(composite2, SWT.CENTER);
label6.setBounds(new Rectangle(111, 56, 29, 13));
label6.setText("oui");
Button checkBox5 = new Button(composite2, SWT.CHECK);
checkBox5.setBounds(new Rectangle(148, 54, 20, 15));
Label label7 = new Label(composite2, SWT.CENTER);
label7.setBounds(new Rectangle(175, 55, 27, 15));
label7.setText("non");
Label label8 = new Label(composite2, SWT.CENTER);
label8.setBounds(new Rectangle(223, 55, 112, 14));
label8.setText("Si non, à abonner ?");
Button checkBox6 = new Button(composite2, SWT.CHECK);
checkBox6.setBounds(new Rectangle(344, 52, 19, 17));
Label label9 = new Label(composite2, SWT.CENTER);
label9.setBounds(new Rectangle(370, 55, 26, 13));
label9.setText("oui");
Label label10 = new Label(composite2, SWT.CENTER);
label10.setBounds(new Rectangle(431, 56, 39, 14));
label10.setText("non");
Button checkBox7 = new Button(composite2, SWT.CHECK);
checkBox7.setBounds(new Rectangle(405, 53, 18, 17));
Label label11 = new Label(composite2, SWT.CENTER);
label11.setBounds(new Rectangle(8, 79, 90, 18));
label11.setText("Rythme annuel :");
Button checkBox8 = new Button(composite2, SWT.CHECK);
checkBox8.setBounds(new Rectangle(4, 108, 19, 14));
Button checkBox9 = new Button(composite2, SWT.CHECK);
checkBox9.setBounds(new Rectangle(94, 106, 20, 18));
Button checkBox10 = new Button(composite2, SWT.CHECK);
checkBox10.setBounds(new Rectangle(171, 104, 19, 19));
Label label12 = new Label(composite2, SWT.CENTER);
label12.setBounds(new Rectangle(29, 107, 58, 15));
label12.setText("Diagnostic");
Label label13 = new Label(composite2, SWT.CENTER);
label13.setBounds(new Rectangle(123, 107, 41, 14));
label13.setText("LHE");
Label label14 = new Label(composite2, SWT.CENTER);
label14.setBounds(new Rectangle(197, 106, 74, 15));
label14.setText("LHN HPE/THPE");
Button checkBox11 = new Button(composite2, SWT.CHECK);
checkBox11.setBounds(new Rectangle(280, 106, 18, 16));
Label label15 = new Label(composite2, SWT.CENTER);
label15.setBounds(new Rectangle(304, 107, 71, 14));
label15.setText("LHN HPE/THPE");
Button checkBox12 = new Button(composite2, SWT.CHECK);
checkBox12.setBounds(new Rectangle(379, 106, 18, 15));
Label label16 = new Label(composite2, SWT.CENTER);
label16.setBounds(new Rectangle(403, 106, 79, 16));
label16.setText("LHN RT 2000");
Label label17 = new Label(composite2, SWT.CENTER);
label17.setBounds(new Rectangle(9, 142, 166, 16));
label17.setText("Attestation Consuel optionnelle :");
Button checkBox13 = new Button(composite2, SWT.CHECK);
checkBox13.setBounds(new Rectangle(206, 144, 19, 14));
Button checkBox14 = new Button(composite2, SWT.CHECK);
checkBox14.setBounds(new Rectangle(271, 145, 19, 13));
Label label18 = new Label(composite2, SWT.CENTER);
label18.setBounds(new Rectangle(233, 145, 33, 14));
label18.setText("oui");
Label label19 = new Label(composite2, SWT.CENTER);
label19.setBounds(new Rectangle(301, 145, 40, 14));
label19.setText("non");
Label label20 = new Label(composite2, SWT.CENTER);
label20.setBounds(new Rectangle(12, 169, 164, 14));
label20.setText("Catalogue de Publication :");
Button checkBox15 = new Button(composite2, SWT.CHECK);
checkBox15.setBounds(new Rectangle(207, 169, 20, 15));
Label label21 = new Label(composite2, SWT.CENTER);
label21.setBounds(new Rectangle(233, 171, 33, 13));
label21.setText("oui");
Button checkBox16 = new Button(composite2, SWT.CHECK);
checkBox16.setBounds(new Rectangle(271, 168, 21, 13));
Label label22 = new Label(composite2, SWT.CENTER);
label22.setBounds(new Rectangle(302, 168, 40, 14));
label22.setText("non");
Label label23 = new Label(composite2, SWT.CENTER);
label23.setBounds(new Rectangle(11, 195, 166, 14));
label23.setText("Connaissance du site internet :");
Button checkBox17 = new Button(composite2, SWT.CHECK);
checkBox17.setBounds(new Rectangle(207, 195, 19, 16));
Label label24 = new Label(composite2, SWT.CENTER);
label24.setBounds(new Rectangle(234, 198, 32, 13));
label24.setText("oui");
Button checkBox18 = new Button(composite2, SWT.CHECK);
checkBox18.setBounds(new Rectangle(273, 197, 19, 14));
Label label25 = new Label(composite2, SWT.CENTER);
label25.setBounds(new Rectangle(303, 197, 39, 14));
label25.setText("non");
Label label26 = new Label(composite2, SWT.CENTER);
label26.setBounds(new Rectangle(14, 227, 50, 17));
label26.setText("Atelier(s)");
Button checkBox19 = new Button(composite2, SWT.CHECK);
checkBox19.setBounds(new Rectangle(72, 228, 17, 15));
Label label27 = new Label(composite2, SWT.CENTER);
label27.setBounds(new Rectangle(95, 227, 33, 13));
label27.setText("oui");
Button checkBox20 = new Button(composite2, SWT.CHECK);
checkBox20.setBounds(new Rectangle(137, 228, 19, 13));
Label label28 = new Label(composite2, SWT.CENTER);
label28.setBounds(new Rectangle(162, 227, 29, 14));
label28.setText("non");
Label label29 = new Label(composite2, SWT.CENTER);
label29.setBounds(new Rectangle(208, 226, 75, 18));
label29.setText("Si oui, lequel ?");
Text hy = new Text(composite2, SWT.BORDER);
hy.setBounds(new Rectangle(299, 226, 209, 18));
Label label30 = new Label(composite2, SWT.CENTER);
label30.setBounds(new Rectangle(228, 254, 41, 16));
label30.setText("date");
Text mp = new Text(composite2, SWT.BORDER);
mp.setBounds(new Rectangle(299, 253, 61, 19));
onglet4.setControl(composite3);
Table table = new Table(composite3, SWT.BORDER);
table.setHeaderVisible(true);
table.setLinesVisible(true);
table.setBounds(new Rectangle(89, 66, 404, 170));
Label po = new Label(composite3, SWT.CENTER);
po.setBounds(new Rectangle(4, 34, 76, 19));
po.setText("Suivi :");
TableColumn tableColumn = new TableColumn(table, SWT.CENTER);
tableColumn.setWidth(203);
tableColumn.setText("QUOI");
TableColumn tableColumn1 = new TableColumn(table, SWT.CENTER);
tableColumn1.setWidth(90);
tableColumn1.setText("QUAND");
TableColumn tableColumn11 = new TableColumn(table, SWT.CENTER);
tableColumn11.setWidth(109);
tableColumn11.setText("QUI");
}
public static void main(String[] args) {
new Test_SWT();
}
}
Voici la classe que j'ai créé pour mon projet. si sa peut aider
olivier