package menuDessin;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JSeparator;
/**
* Estimate maker java application with GUI.
* This class handles the buttons on the right side, so choose the types of drawings.
*
* @author Mohammad Saman, Vivor Kevin
*/

public class Option extends JPanel {
	
	private static final long serialVersionUID = 1L;
	
	public Option() 
	{
		JButton bouton1 = new JButton("Rectangle");
		JButton bouton2 = new JButton("Trait");
		
		JPanel pan = new JPanel();
		pan.setLayout(new GridLayout(2,1));
		pan.add(bouton1);
		pan.add(bouton2);
		
		Box panneauBouton = Box.createVerticalBox();
		panneauBouton.add(pan);
		panneauBouton.add(Box.createVerticalStrut(20));
		panneauBouton.add(new JSeparator(JSeparator.HORIZONTAL));
		//panneauBouton.add(Box.createGlue());
		this.add(panneauBouton,BorderLayout.CENTER );
		this.setBackground(Color.decode("#2766A1"));
		//setPreferredSize(new Dimension(180,0));
	 } 
}
@@ -447,13 +447,36 @@
 nel 
-%7B%0A%09%0A%09
+implements ActionListener %7B%0A
 priv
@@ -520,19 +520,141 @@
 D = 1L;%0A
-%09%0A%09
+JButton bouton1 ;%0AJButton bouton2;%0AString%5B%5D point = %7B%223%22,%224%22,%225%22,%226%22,%227%22,%228%22,%229%22,%2210%22%7D;%0Astatic int sommet;%0APolygon_app poly;%0A
 public O
@@ -664,23 +664,14 @@
 on()
- 
 %0A%09%7B%0A%09%09
-JButton 
 bout
@@ -693,31 +693,22 @@
 on(%22
-Rectangle
+polygon
 %22);%0A
+ 
 %09%09
-JButton 
 bout
@@ -730,20 +730,19 @@
 on(%22
-Trait
+Effacer
 %22);%0A
-%09%09%0A
 %09%09JP
@@ -830,28 +830,95 @@
 ;%0A%09%09
-pan.add(bouton2);%0A%09%09
+bouton1.addActionListener(this);%0A%09%09pan.add(bouton2);%0A%09%09bouton2.addActionListener(this);
 %0A%09%09B
@@ -1282,9 +1282,537 @@
 );%0A%09
- %7D %0A%7D
+%7D%0A@Override%0Apublic void actionPerformed(ActionEvent e) %7B%0A%09// TODO Auto-generated method stub%0A%09if(e.getSource()== bouton1)%7B%0A%09%09   %0A%09%7D%0A%09if(e.getSource()==bouton2)%7B%0A%09%09%0A%09%09%09    %0A%09%09%09    sommet=Integer.parseInt((String) JOptionPane.showInputDialog(null, %22Nombre de sommet%22, %22Polygone%22, JOptionPane.QUESTION_MESSAGE, null, point,point%5B2%5D));%0A%09%09%09   /* poly=new Polygon_app();%0A%09%09%09    Option.setDessin(poly);%0A%09%09%09%09sommet=5;*/%0A%09%09%09    %0A%09%7D%0A%7D%0Apublic static int getSommet() %7B%0A%09%0A%09return sommet;%0A%7D%0Apublic static void setSommet(int s) %7B%0A%09%09sommet = s;%0A%7D%0A%7D%0A

Update Option.java