package SE2;


import java.awt.*;



import javax.swing.*;

public class IHMPoste extends JFrame {

		
		private JPanel f2 = new JPanel(new GridLayout(3,0));
		private JPanel f3 = new JPanel( new GridLayout(2,3));
		private JPanel f4 = new JPanel(new GridLayout(0,3));
		private JComboBox cb = new JComboBox();
		
		private String texte = "vide";
		private JTextArea f1= new JTextArea(texte);
		private JScrollPane sc=new JScrollPane(f1);
		private JButton b1 = new JButton("Ajouter");
		private JButton b2 = new JButton("Quitter");
		private JButton b3 = new JButton("Affranchir");
		private JCheckBox cb2 = new JCheckBox("Urgente");
		private Sac s = new Sac(100);
		private JTextField tf = new JTextField();
		private JTextField tf1 = new JTextField("0.0");
		private JLabel volume = new JLabel("Volume colis");
		private JLabel volume2 = new JLabel("Volume sac");
		private JLabel capa = new JLabel("Capacité sac : 100");
		
		private CoursierListener cl = new CoursierListener(f1,tf1,cb,s,cb2,tf);
		
		
	public IHMPoste(){
		cb.addItem("Lettre");
		cb.addItem("Colis");
		tf1.setEnabled(false);
		
		f4.add(b1);
		f4.add(b2);
		f4.add(b3);
		f2.add(cb);
		f2.add(f3);
		f2.add(f4);
		f3.add(cb2);
		f3.add(volume);
		f3.add(tf);
		f3.add(capa);
		f3.add(volume2);
		f3.add(tf1);
		this.add(f2);
		this.add(sc);
		b1.addActionListener(cl);
		b2.addActionListener(cl);
		b3.addActionListener(cl);
		this.setPreferredSize(new Dimension(700,300));
		this.setTitle("Poste");
		this.getContentPane().setLayout(new GridLayout(0,2));
		this.pack();
		this.setVisible(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
	}
	
	
	

}
