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
| public class Main {
public static void main (String[] args){
/* Interface graphique */
SwingUtilities.invokeLater(new Runnable(){
public void run(){
//On crée une nouvelle instance la fenêtre
// création + configuration + mise en place des composants
MyFrame fenetre = new MyFrame( new FrameSet("Filtre des catalogues Fournisseurs", 400, 300, true, true, JFrame.EXIT_ON_CLOSE), new Color(230, 240, 254));
fenetre.setVisible(true);//On la rend visible
// récupération du panel
MyPanel panel=fenetre.getPanel();
/* ajout des composants */
// parsing automatique
panel.addLabel("label1", "...");
String[] champs1 = new String[]{...};
panel.addListe("menu1", champs1);
panel.addBoutton("filtrer", new AutoParsingAction("filtrer", panel));
//parsing manuel
panel.addLabel("label2", "...");
panel.addZoneDeSaisie("url", 12);
String[] champs2 = new String[]{...};
panel.addListe("menu2", champs2);
panel.addBoutton("filtrer", new ManParsingAction("filtrer", panel));
}
});
}
} |
Partager