//ChoicePanel
/* A Java class for
 * LossyWide.java
 * Electromagnetic Transmission Line Applet
 * Applet without Smith Chart - Prepared by Umberto Ravaioli 
 * for 6th edition of Fundamentals of Applied Electromagnetics Book
 * May 2009 - All Rights Reserved
 */ 
import java.awt.*;
import java.applet.*;
import java.lang.*;  


public class ChoicePanel extends Panel{ 
	public Choice c1;
	public Choice c2;
	private  Label lab1, lab2;
	
	private static final Color bgcolor = new Color(236,236,236);
	private static final Color tinta = new Color(236,236,236);
        public static Font labelfont;
        public static Font normalfont;

	
	public ChoicePanel(String arg1[], String arg2[]){
		super();
		//setLayout(new FlowLayout());
                setLayout(null);
		setBackground(bgcolor);
		//Font labelfont=new Font("SanSerif",Font.BOLD,14);
		lab1=new Label(arg1[0],Label.RIGHT);
		lab1.setFont(labelfont);
		add(lab1);
		//lab1.setBounds(10,10,70,20);
		lab1.setBounds(10,10,73,20);
                
		c1=new Choice();
		for(int i = 1; i < arg1.length; i++){
		    c1.addItem(arg1[i]);
		}
		// CHANGE ======================================================
                //c1.setBounds(85,8,190,20);
                c1.setBounds(85,8,200,20);
                //==============================================================
                
		add(c1);
		//c1.setFont(new Font("SanSerif",Font.PLAIN,14));
                c1.setFont(normalfont);
		c1.setBackground(Color.white);
		//c1.setBackground(bgcolor.brighter());
		c1.setForeground(Color.black);
		
		lab2=new Label(arg2[0],Label.RIGHT);
		lab2.setFont(labelfont);
		//add(lab2);
		c2=new Choice();
		for(int i = 1; i < arg2.length; i++){
		    c2.addItem(arg2[i]);
		}
		//add(c2);
		//c2.setFont(new Font("SanSerif",Font.PLAIN,11));
		c2.setBackground(tinta);
		//c2.setBackground(bgcolor.brighter());
		c2.setForeground(Color.black);
		
	}
	public void paint(Graphics g){
	    g.clearRect(0,0,getSize().width,getSize().height);
	    g.setColor(bgcolor.darker());
	    g.fillRect(0,getSize().height-2,getSize().width,2);
	    g.fillRect(getSize().width-2,0,2,getSize().height);
	    g.setColor(bgcolor.brighter());
	    g.fillRect(0,0,2,getSize().height-1);
	    g.fillRect(0,0,getSize().width-2,2);
	}
	
} // ChoicePanel.java
