Advertisement
Guest User

monCode

a guest
Apr 13th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 17.80 KB | None | 0 0
  1. package fr.ducherudy.mesclasses;
  2.  
  3. import java.awt.*;
  4. import java.awt.event.*;
  5.  
  6. import javax.swing.*;
  7.  
  8.  
  9.  
  10.  
  11. public class Fenetre extends JFrame implements ActionListener {
  12.    
  13.  
  14.     private static final long serialVersionUID = 1L;
  15.     JTabbedPane tabbedPane = new JTabbedPane();
  16.     JPanel panVins = new JPanel();
  17.     JPanel panAjout = new JPanel();
  18.     JPanel panSuppMod = new JPanel();
  19.     Color colorBack = new Color(133,22,54);
  20.    
  21.     public Fenetre(){
  22.        
  23.  
  24.         Dimension monecran = Toolkit.getDefaultToolkit().getScreenSize();
  25.         int x = (monecran.width/2);
  26.         int y = (monecran.height/2);
  27.                
  28.        
  29.         this.pack();
  30.         this.setTitle("Ma Cave à Vin");
  31.         this.setSize(530,400);
  32.         this.setLocation((x-(this.getWidth()/2)),(y-(this.getHeight()/2)));
  33.         this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  34.         this.setResizable(false);
  35.  
  36.         this.setVisible(true);
  37.        
  38.         tabbedPane.addTab("Gestion des Vins",panVins);
  39.         tabbedPane.addTab("Ajout d'un Vin", panAjout);
  40.         tabbedPane.addTab("Supprimer ou Modifier un Vin", panSuppMod);
  41.  
  42.                        
  43.         this.setContentPane(tabbedPane);
  44.              
  45.        
  46.         gestionCave();
  47.         ajoutVins();
  48.         suppModVins();
  49.        
  50.        
  51.        
  52.     }
  53.  
  54.     public void gestionCave(){
  55.         JTextField monVin = new JTextField();
  56.        
  57.         JList mesVins = new JList();
  58.        
  59.        
  60.         JLabel nomB = new JLabel("Bouteille : ");
  61.         JLabel contB = new JLabel("Contenance : ");
  62.         JLabel prixB = new JLabel("Prix : ");
  63.         JLabel anneeB = new JLabel("Année :");
  64.         JLabel qteB = new JLabel("Quantité : ");
  65.         JLabel catB = new JLabel("Catégorie : ");
  66.         JLabel regB = new JLabel("Region : ");
  67.         JLabel paysB = new JLabel("Pays : ");
  68.         JLabel cepB = new JLabel("Cepage : ");
  69.         JLabel appB = new JLabel("Appellation : ");
  70.         JTextField texteBout = new JTextField();
  71.  
  72.         JTextField nomT = new JTextField();
  73.         JTextField contT = new JTextField();
  74.         JTextField prixT = new JTextField();
  75.         JTextField anneeT = new JTextField();
  76.         JTextField qteT = new JTextField();
  77.         JTextField catT = new JTextField();
  78.         JTextField regT = new JTextField();
  79.         JTextField paysT = new JTextField();
  80.         JTextField cepT = new JTextField();
  81.         JTextField appT = new JTextField();
  82.        
  83.         texteBout.setSize(510, 30);
  84.         texteBout.setLocation(5,305);
  85.         texteBout.setText("Texte concernant une bouteille");
  86.         texteBout.setEditable(false);
  87.         panVins.add(texteBout);
  88.        
  89.         monVin.setSize(200,20);
  90.         monVin.setLocation(5, 10);
  91.        
  92.         mesVins.setSize(200, 260);
  93.         mesVins.setLocation(5, 40);
  94.         mesVins.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
  95.         mesVins.setLayoutOrientation(JList.HORIZONTAL_WRAP);
  96.        
  97.         //Les JLabel
  98.         nomB.setSize(100,20);
  99.         nomB.setLocation(210, 10);
  100.         nomB.setForeground(Color.YELLOW);
  101.        
  102.         contB.setSize(100,20);
  103.         contB.setLocation(210, 40);
  104.         contB.setForeground(Color.YELLOW);
  105.        
  106.         prixB.setSize(100,20);
  107.         prixB.setLocation(210, 70);
  108.         prixB.setForeground(Color.YELLOW);
  109.        
  110.         anneeB.setSize(100,20);
  111.         anneeB.setLocation(210, 100);
  112.         anneeB.setForeground(Color.YELLOW);
  113.        
  114.         qteB.setSize(100,20);
  115.         qteB.setLocation(210, 130);
  116.         qteB.setForeground(Color.YELLOW);
  117.        
  118.         catB.setSize(100,20);
  119.         catB.setLocation(210, 160);
  120.         catB.setForeground(Color.YELLOW);
  121.        
  122.         regB.setSize(100,20);
  123.         regB.setLocation(210, 190);
  124.         regB.setForeground(Color.YELLOW);
  125.        
  126.         paysB.setSize(100,20);
  127.         paysB.setLocation(210, 220);
  128.         paysB.setForeground(Color.YELLOW);
  129.        
  130.         cepB.setSize(100,20);
  131.         cepB.setLocation(210, 250);
  132.         cepB.setForeground(Color.YELLOW);
  133.        
  134.         appB.setSize(100,20);
  135.         appB.setLocation(210, 280);
  136.         appB.setForeground(Color.YELLOW);
  137.                
  138.         //les JTextField
  139.         nomT.setSize(200,20);
  140.         nomT.setLocation(315, 10);
  141.         nomT.setEditable(false);
  142.        
  143.         contT.setSize(200,20);
  144.         contT.setLocation(315, 40);
  145.         contT.setEditable(false);
  146.        
  147.         prixT.setSize(200,20);
  148.         prixT.setLocation(315, 70);
  149.         prixT.setEditable(false);
  150.        
  151.         anneeT.setSize(200,20);
  152.         anneeT.setLocation(315, 100);
  153.         anneeT.setEditable(false);
  154.        
  155.         qteT.setSize(200,20);
  156.         qteT.setLocation(315, 130);
  157.         qteT.setEditable(false);
  158.        
  159.         catT.setSize(200,20);
  160.         catT.setLocation(315, 160);
  161.         catT.setEditable(false);
  162.        
  163.         regT.setSize(200,20);
  164.         regT.setLocation(315, 190);
  165.         regT.setEditable(false);
  166.        
  167.         paysT.setSize(200,20);
  168.         paysT.setLocation(315, 220);
  169.         paysT.setEditable(false);
  170.        
  171.         cepT.setSize(200,20);
  172.         cepT.setLocation(315, 250);
  173.         cepT.setEditable(false);
  174.        
  175.         appT.setSize(200,20);
  176.         appT.setLocation(315, 280);
  177.         appT.setEditable(false);
  178.        
  179.         panVins.setBackground(colorBack);
  180.         panVins.setBorder(BorderFactory.createLineBorder(Color.black));
  181.        
  182.         //Partie Gauche
  183.         panVins.add(monVin);
  184.         panVins.add(mesVins);
  185.        
  186.        
  187.         //Les JLabels
  188.         panVins.add(nomB);
  189.         panVins.add(contB);
  190.         panVins.add(prixB);
  191.         panVins.add(anneeB);
  192.         panVins.add(qteB);
  193.         panVins.add(catB);
  194.         panVins.add(regB);
  195.         panVins.add(paysB);
  196.         panVins.add(cepB);
  197.         panVins.add(appB);
  198.        
  199.         //les JTextField
  200.         panVins.add(nomT);
  201.         panVins.add(contT);
  202.         panVins.add(prixT);
  203.         panVins.add(anneeT);
  204.         panVins.add(qteT);
  205.         panVins.add(catT);
  206.         panVins.add(regT);
  207.         panVins.add(paysT);
  208.         panVins.add(cepT);
  209.         panVins.add(appT);     
  210.                
  211.         panVins.setVisible(true);
  212.         panVins.setLayout(null);
  213.        
  214.                
  215.         }
  216.    
  217.    
  218.     private void ajoutVins() {
  219.         //NOUVELLES BOUTEILLE
  220.         JLabel boutLbl = new JLabel("BOUTEILLE");
  221.         JLabel nomBLbl = new JLabel("Nom :");
  222.         JLabel contBLbl = new JLabel("Contenance :");
  223.         JLabel prixBLbl = new JLabel("Prix :");
  224.         JLabel anneeBLbl = new JLabel("Annee :");
  225.         JLabel qteBLbl = new JLabel("Quantité :");
  226.         JLabel cepBLbl = new JLabel("Cépage :");
  227.         JLabel catBLbl = new JLabel("Catégorie :");
  228.         JLabel paysBLbl = new JLabel("Pays :");
  229.         JLabel regBLbl = new JLabel("Région :");
  230.         JLabel appBLbl = new JLabel("Appéllation :");
  231.        
  232.        
  233.         JTextField nomTF = new JTextField();
  234.         JTextField contTF = new JTextField();
  235.         JTextField prixTF = new JTextField();
  236.         JTextField anneeTF = new JTextField();
  237.         JTextField qteTF = new JTextField();
  238.        
  239.         JComboBox cepCB = new JComboBox();
  240.         JComboBox appCB = new JComboBox();
  241.         JComboBox regCB = new JComboBox();
  242.         JComboBox paysCB = new JComboBox();
  243.         JComboBox catCB = new JComboBox();
  244.        
  245.         //NOUVELLES CATEGORIE
  246.         JLabel catLbl = new JLabel("CATEGORIE");
  247.         JLabel libelleCLbl = new JLabel("Libellé :");
  248.        
  249.         JTextField libelleCTF = new JTextField();
  250.        
  251.         //NOUVEAU CEPAGE
  252.         JLabel cepLbl = new JLabel("CEPAGE");
  253.         JLabel libelleCepLbl = new JLabel("Libellé :");
  254.        
  255.         JTextField libelleCepTF = new JTextField();
  256.        
  257.         //NOUVELLE APPELLATION
  258.         JLabel appLbl = new JLabel("APPELLATION");
  259.         JLabel libelleAppLbl = new JLabel("Libellé :");
  260.        
  261.         JTextField libelleAppTF = new JTextField();
  262.        
  263.         //NOUVEAU PAYS
  264.         JLabel paysLbl = new JLabel("PAYS");
  265.         JLabel codePLbl = new JLabel("Code :");
  266.         JLabel libellePLbl = new JLabel("Libellé :");
  267.        
  268.         JTextField codePTF = new JTextField();
  269.         JTextField libellePTF = new JTextField();
  270.        
  271.         //NOUVELLE REGION
  272.         JLabel regRLbl = new JLabel("REGION");
  273.         JLabel libelleRLbl = new JLabel("Libellé :");
  274.  
  275.         JTextField libelleRTF = new JTextField();
  276.        
  277.         JButton boutBtn = new JButton("Ajouter");
  278.         JButton cepBtn = new JButton("Ajouter");
  279.         JButton appBtn = new JButton("Ajouter");
  280.         JButton regBtn = new JButton("Ajouter");
  281.         JButton paysBtn = new JButton("Ajouter");
  282.         JButton catBtn = new JButton("Ajouter");
  283.        
  284.  
  285.        
  286.            
  287.         boutLbl.setSize(90,15);
  288.         boutLbl.setLocation(0,0);
  289.         boutLbl.setForeground(Color.YELLOW);
  290.        
  291.         nomBLbl.setSize(90,15);
  292.         nomBLbl.setLocation(0,15);
  293.         nomBLbl.setForeground(Color.YELLOW);
  294.        
  295.         nomTF.setSize(90,15);
  296.         nomTF.setLocation(95,15);
  297.                
  298.         contBLbl.setSize(90,15);
  299.         contBLbl.setLocation(0,30);
  300.         contBLbl.setForeground(Color.YELLOW);
  301.        
  302.         contTF.setSize(90,15);
  303.         contTF.setLocation(95,30);
  304.                
  305.         prixBLbl.setSize(90,15);
  306.         prixBLbl.setLocation(0,45);
  307.         prixBLbl.setForeground(Color.YELLOW);
  308.        
  309.         prixTF.setSize(90,15);
  310.         prixTF.setLocation(95,45);
  311.        
  312.         anneeBLbl.setSize(90,15);
  313.         anneeBLbl.setLocation(0,60);
  314.         anneeBLbl.setForeground(Color.YELLOW);
  315.        
  316.         anneeTF.setSize(90,15);
  317.         anneeTF.setLocation(95,60);
  318.        
  319.         qteBLbl.setSize(90,15);
  320.         qteBLbl.setLocation(0,75);
  321.         qteBLbl.setForeground(Color.YELLOW);
  322.        
  323.         qteTF.setSize(90,15);
  324.         qteTF.setLocation(95,75);      
  325.        
  326.         catBLbl.setSize(90,15);
  327.         catBLbl.setLocation(0,90);
  328.         catBLbl.setForeground(Color.YELLOW);
  329.        
  330.         catCB.setSize(90,15);
  331.         catCB.setLocation(95,90);
  332.        
  333.         paysBLbl.setSize(90,15);
  334.         paysBLbl.setLocation(0,105);
  335.         paysBLbl.setForeground(Color.YELLOW);
  336.        
  337.         paysCB.setSize(90,15);
  338.         paysCB.setLocation(95,105);    
  339.        
  340.         regBLbl.setSize(90,15);
  341.         regBLbl.setLocation(0,120);
  342.         regBLbl.setForeground(Color.YELLOW);
  343.        
  344.         regCB.setSize(90,15);
  345.         regCB.setLocation(95,120);
  346.        
  347.         cepBLbl.setSize(90,15);
  348.         cepBLbl.setLocation(0,135);
  349.         cepBLbl.setForeground(Color.YELLOW);
  350.        
  351.         cepCB.setSize(90,15);
  352.         cepCB.setLocation(95,135);     
  353.        
  354.         appBLbl.setSize(90,15);
  355.         appBLbl.setLocation(0,150);
  356.         appBLbl.setForeground(Color.YELLOW);
  357.        
  358.         appCB.setSize(90,15);
  359.         appCB.setLocation(95,150);
  360.        
  361.         boutBtn.setSize(185,20);
  362.         boutBtn.setLocation(0,170);
  363.         boutBtn.setName("boutBtn");
  364.         boutBtn.addActionListener(this);
  365.  
  366.        
  367.         catLbl.setSize(90,15);
  368.         catLbl.setLocation(0,215);
  369.         catLbl.setForeground(Color.YELLOW);
  370.        
  371.         libelleCLbl.setSize(90,15);
  372.         libelleCLbl.setLocation(0,230);
  373.         libelleCLbl.setForeground(Color.YELLOW);
  374.        
  375.         libelleCTF.setSize(90,15);
  376.         libelleCTF.setLocation(95,230);
  377.        
  378.         catBtn.setSize(185,20);
  379.         catBtn.setLocation(0,250);
  380.         catBtn.setName("catBtn");
  381.         catBtn.addActionListener(this);
  382.        
  383.        
  384.         //2EME COLONNE
  385.         cepLbl.setSize(90,15);
  386.         cepLbl.setLocation(200,0);
  387.         cepLbl.setForeground(Color.YELLOW);
  388.        
  389.         libelleCepLbl.setSize(90,15);
  390.         libelleCepLbl.setLocation(200,15);
  391.         libelleCepLbl.setForeground(Color.YELLOW);
  392.        
  393.         libelleCepTF.setSize(90,15);
  394.         libelleCepTF.setLocation(295,15);
  395.        
  396.         cepBtn.setSize(185,20);
  397.         cepBtn.setLocation(200,35);
  398.         cepBtn.setName("cepBtn");
  399.         cepBtn.addActionListener(this);
  400.                
  401.         appLbl.setSize(90,15);
  402.         appLbl.setLocation(200,80);
  403.         appLbl.setForeground(Color.YELLOW);
  404.        
  405.         libelleAppLbl.setSize(90,15);
  406.         libelleAppLbl.setLocation(200,95);
  407.         libelleAppLbl.setForeground(Color.YELLOW);
  408.        
  409.         libelleAppTF.setSize(90,15);
  410.         libelleAppTF.setLocation(295,95);
  411.        
  412.         appBtn.setSize(185,20);
  413.         appBtn.setLocation(200,115);
  414.         appBtn.setName("appBtn");
  415.         appBtn.addActionListener(this);
  416.        
  417.         paysLbl.setSize(90,15);
  418.         paysLbl.setLocation(200,160);
  419.         paysLbl.setForeground(Color.YELLOW);
  420.        
  421.         codePLbl.setSize(90,15);
  422.         codePLbl.setLocation(200,175);
  423.         codePLbl.setForeground(Color.YELLOW);
  424.        
  425.         codePTF.setSize(90,15);
  426.         codePTF.setLocation(295,175);
  427.                
  428.         libellePLbl.setSize(90,15);
  429.         libellePLbl.setLocation(200,190);
  430.         libellePLbl.setForeground(Color.YELLOW);
  431.        
  432.         libellePTF.setSize(90,15);
  433.         libellePTF.setLocation(295,190);
  434.                
  435.         paysBtn.setSize(185,20);
  436.         paysBtn.setLocation(200,210);
  437.         paysBtn.setName("paysBtn");
  438.         paysBtn.addActionListener(this);
  439.        
  440.         regRLbl.setSize(90,15);
  441.         regRLbl.setLocation(200,255);
  442.         regRLbl.setForeground(Color.YELLOW);
  443.        
  444.         libelleRLbl.setSize(90,15);
  445.         libelleRLbl.setLocation(200,270);
  446.         libelleRLbl.setForeground(Color.YELLOW);
  447.        
  448.         libelleRTF.setSize(90,15);
  449.         libelleRTF.setLocation(295,270);
  450.        
  451.         regBtn.setSize(185,20);
  452.         regBtn.setLocation(200,290);
  453.         regBtn.setName("regBtn");
  454.         regBtn.addActionListener(this);    
  455.        
  456.         panAjout.add(boutLbl);
  457.         panAjout.add(nomBLbl);
  458.         panAjout.add(contBLbl);
  459.         panAjout.add(prixBLbl);
  460.         panAjout.add(anneeBLbl);
  461.         panAjout.add(qteBLbl);
  462.         panAjout.add(cepBLbl);
  463.         panAjout.add(regBLbl);
  464.         panAjout.add(appBLbl);
  465.         panAjout.add(paysBLbl);
  466.         panAjout.add(catBLbl);
  467.         panAjout.add(catCB);
  468.         panAjout.add(paysCB);
  469.         panAjout.add(regCB);
  470.         panAjout.add(cepCB);
  471.         panAjout.add(appCB);       
  472.         panAjout.add(nomTF);
  473.         panAjout.add(contTF);
  474.         panAjout.add(prixTF);
  475.         panAjout.add(anneeTF);
  476.         panAjout.add(qteTF);
  477.         panAjout.add(catLbl);
  478.         panAjout.add(libelleCLbl);
  479.         panAjout.add(libelleCTF);
  480.         panAjout.add(cepLbl);
  481.         panAjout.add(libelleCepLbl);
  482.         panAjout.add(libelleCepTF);
  483.         panAjout.add(appLbl);
  484.         panAjout.add(libelleAppLbl);
  485.         panAjout.add(libelleAppTF);
  486.         panAjout.add(paysLbl);
  487.         panAjout.add(codePLbl);
  488.         panAjout.add(libellePLbl);
  489.         panAjout.add(codePTF);
  490.         panAjout.add(libellePTF);
  491.         panAjout.add(regRLbl);
  492.         panAjout.add(libelleRLbl);
  493.         panAjout.add(libelleRTF);
  494.         panAjout.add(boutBtn);
  495.         panAjout.add(catBtn);
  496.         panAjout.add(cepBtn);
  497.         panAjout.add(regBtn);
  498.         panAjout.add(appBtn);
  499.         panAjout.add(paysBtn);
  500.        
  501.         panAjout.setBackground(colorBack);
  502.         panAjout.setBorder(BorderFactory.createLineBorder(Color.black));
  503.         panAjout.setLayout(null);
  504.         panAjout.setVisible(true);
  505.        
  506.     }
  507.        
  508.    
  509.     private void suppModVins() {
  510.         JTextField monVin = new JTextField();
  511.        
  512.         JList mesVins = new JList();
  513.        
  514.         JLabel nomB = new JLabel("Bouteille : ");
  515.         JLabel contB = new JLabel("Contenance : ");
  516.         JLabel prixB = new JLabel("Prix : ");
  517.         JLabel anneeB = new JLabel("Année :");
  518.         JLabel qteB = new JLabel("Quantité : ");
  519.         JLabel catB = new JLabel("Catégorie : ");
  520.         JLabel regB = new JLabel("Region : ");
  521.         JLabel paysB = new JLabel("Pays : ");
  522.         JLabel cepB = new JLabel("Cepage : ");
  523.         JLabel appB = new JLabel("Appellation : ");
  524.        
  525.         JTextField nomT = new JTextField();
  526.         JTextField contT = new JTextField();
  527.         JTextField prixT = new JTextField();
  528.         JTextField anneeT = new JTextField();
  529.         JTextField qteT = new JTextField();
  530.         JTextField catT = new JTextField();
  531.         JTextField regT = new JTextField();
  532.         JTextField paysT = new JTextField();
  533.         JTextField cepT = new JTextField();
  534.         JTextField appT = new JTextField();
  535.        
  536.         JButton majB = new JButton("Mettre à jour");
  537.         JButton suppB = new JButton("Supprimer");
  538.        
  539.         monVin.setSize(200,20);
  540.         monVin.setLocation(5, 10);
  541.        
  542.         mesVins.setSize(200, 300);
  543.         mesVins.setLocation(5, 40);
  544.         mesVins.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
  545.         mesVins.setLayoutOrientation(JList.HORIZONTAL_WRAP);
  546.        
  547.         panSuppMod.setBackground(colorBack);
  548.         panSuppMod.setBorder(BorderFactory.createLineBorder(Color.black));
  549.        
  550.         //Partie Gauche
  551.         panSuppMod.add(monVin);
  552.         panSuppMod.add(mesVins);
  553.        
  554.        
  555.        
  556.        
  557.         //Les JLabel
  558.         nomB.setSize(100,20);
  559.         nomB.setLocation(210, 10);
  560.         nomB.setForeground(Color.YELLOW);
  561.        
  562.         contB.setSize(100,20);
  563.         contB.setLocation(210, 40);
  564.         contB.setForeground(Color.YELLOW);
  565.        
  566.         prixB.setSize(100,20);
  567.         prixB.setLocation(210, 70);
  568.         prixB.setForeground(Color.YELLOW);
  569.        
  570.         anneeB.setSize(100,20);
  571.         anneeB.setLocation(210, 100);
  572.         anneeB.setForeground(Color.YELLOW);
  573.        
  574.         qteB.setSize(100,20);
  575.         qteB.setLocation(210, 130);
  576.         qteB.setForeground(Color.YELLOW);
  577.        
  578.         catB.setSize(100,20);
  579.         catB.setLocation(210, 160);
  580.         catB.setForeground(Color.YELLOW);
  581.        
  582.         regB.setSize(100,20);
  583.         regB.setLocation(210, 190);
  584.         regB.setForeground(Color.YELLOW);
  585.        
  586.         paysB.setSize(100,20);
  587.         paysB.setLocation(210, 220);
  588.         paysB.setForeground(Color.YELLOW);
  589.        
  590.         cepB.setSize(100,20);
  591.         cepB.setLocation(210, 250);
  592.         cepB.setForeground(Color.YELLOW);
  593.        
  594.         appB.setSize(100,20);
  595.         appB.setLocation(210, 280);
  596.         appB.setForeground(Color.YELLOW);
  597.                
  598.         //les JTextField
  599.         nomT.setSize(200,20);
  600.         nomT.setLocation(315, 10);
  601.  
  602.        
  603.         contT.setSize(200,20);
  604.         contT.setLocation(315, 40);
  605.  
  606.        
  607.         prixT.setSize(200,20);
  608.         prixT.setLocation(315, 70);
  609.  
  610.        
  611.         anneeT.setSize(200,20);
  612.         anneeT.setLocation(315, 100);
  613.  
  614.        
  615.         qteT.setSize(200,20);
  616.         qteT.setLocation(315, 130);
  617.  
  618.        
  619.         catT.setSize(200,20);
  620.         catT.setLocation(315, 160);
  621.  
  622.        
  623.         regT.setSize(200,20);
  624.         regT.setLocation(315, 190);
  625.  
  626.        
  627.         paysT.setSize(200,20);
  628.         paysT.setLocation(315, 220);
  629.  
  630.        
  631.         cepT.setSize(200,20);
  632.         cepT.setLocation(315, 250);
  633.  
  634.        
  635.         appT.setSize(200,20);
  636.         appT.setLocation(315, 280);
  637.        
  638.         majB.setSize(140,30);
  639.         majB.setLocation(210, 310);
  640.        
  641.         suppB.setSize(140, 30);
  642.         suppB.setLocation(370, 310);
  643.  
  644.        
  645.         panSuppMod.add(nomB);
  646.         panSuppMod.add(contB);
  647.         panSuppMod.add(prixB);
  648.         panSuppMod.add(anneeB);
  649.         panSuppMod.add(qteB);
  650.         panSuppMod.add(catB);
  651.         panSuppMod.add(regB);
  652.         panSuppMod.add(paysB);
  653.         panSuppMod.add(cepB);
  654.         panSuppMod.add(appB);
  655.        
  656.         //les JTextField
  657.         panSuppMod.add(nomT);
  658.         panSuppMod.add(contT);
  659.         panSuppMod.add(prixT);
  660.         panSuppMod.add(anneeT);
  661.         panSuppMod.add(qteT);
  662.         panSuppMod.add(catT);
  663.         panSuppMod.add(regT);
  664.         panSuppMod.add(paysT);
  665.         panSuppMod.add(cepT);
  666.         panSuppMod.add(appT);  
  667.        
  668.         panSuppMod.add(majB);
  669.         panSuppMod.add(suppB);
  670.        
  671.         panSuppMod.setLayout(null);
  672.         panSuppMod.setVisible(true);
  673.        
  674.        
  675.     }
  676.  
  677.     @Override
  678.     public void actionPerformed(ActionEvent arg0) {
  679.         // TODO Auto-generated method stub
  680.         Object obj = arg0.getSource();
  681.         if (((JButton) obj).getName()=="boutBtn"){         
  682.             JOptionPane.showMessageDialog(this,"Bouton Bouteille","Le Message du Bouton",JOptionPane.INFORMATION_MESSAGE,null);
  683.         }
  684.         if (((JButton) obj).getName()=="cepBtn"){
  685.             JOptionPane.showMessageDialog(this,"Bouton Cépage","Le Message du Bouton",JOptionPane.INFORMATION_MESSAGE,null);
  686.         }
  687.         if (((JButton) obj).getName()=="catBtn"){
  688.             JOptionPane.showMessageDialog(this,"Bouton Catégorie","Le Message du Bouton",JOptionPane.INFORMATION_MESSAGE,null);
  689.         }
  690.         if (((JButton) obj).getName()=="regBtn"){
  691.             JOptionPane.showMessageDialog(this,"Bouton Région","Le Message du Bouton",JOptionPane.INFORMATION_MESSAGE,null);
  692.         }
  693.         if (((JButton) obj).getName()=="appBtn"){
  694.             JOptionPane.showMessageDialog(this,"Bouton Appellation","Le Message du Bouton",JOptionPane.INFORMATION_MESSAGE,null);
  695.         }
  696.         if (((JButton) obj).getName()=="paysBtn"){
  697.             JOptionPane.showMessageDialog(this,"Bouton Pays","Le Message du Bouton",JOptionPane.INFORMATION_MESSAGE,null);
  698.         }
  699.            
  700.            
  701.     }
  702.  
  703.  
  704.  
  705. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement