import java.awt.*;
import java.awt.event.*;

public class DetailedTwoAntennas extends Frame implements ActionListener, AdjustmentListener, ItemListener, MouseListener, WindowListener{
    //About about;
    Instructions instructions;
    Panel instrFrame;
    TitlePanel titlepanel;
    NewGuideCanvas rwc;
    NewGuideCanvas2 rwc2;
    NewGuideInputPanel inputpanel;
    NewGuideInputPanel2 inputpanel2;
    NewGuideInputPanel3 inputpanel3;
    NewGuide_State state;
    SetRangePanel a_panel, a2_panel, frequency_panel, current_panel, current2_panel, distance_panel, adist_panel;
    NewGuideControlPanel rwconp;
    
    /*
            outputpanel2.setBounds(12+xmove,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove,262+ymove,296,296);
    
    */
    
    NewGuideOutputPanel outputpanel;
    NewGuideOutputPanel2 outputpanel2;
    NewGuideOutputPanel3 outputpanel3;
    NewGuideOutputPanel4 outputpanel4;
    NewGuideOutputPanel5 outputpanel5;
    NewGuideOutputPanel4b outputpanel4b;
    NewGuideOutputPanel5b outputpanel5b;
    NewGuideOutputPanel6 outputpanel6;
    NewGuideOutputPanel7 outputpanel7;
    NewGuideOutputPanel8 outputpanel8;
    NewGuideOutputPanel9 outputpanel9;
    NewGuideOutputPanel10 outputpanel10;
    NewGuideOutputPanel11 outputpanel11;
    NewGuideOutputPanel12 outputpanel12;
    NewGuideOutputPanel13 outputpanel13;
    NewGuideOutputPanel14 outputpanel14;
    
    NewGuideOutputPanel13b outputpanel13b;
    NewGuideOutputPanel14b outputpanel14b;
    NewGuideOutputPanel13c outputpanel13c;
    NewGuideOutputPanel14c outputpanel14c;
    
    NewGuideOutputPanel15 outputpanel15;
    NewGuideOutputPanel16 outputpanel16;
    NewGuideOutputPanel17 outputpanel17;
    NewGuideOutputPanel18 outputpanel18;
    NewGuideOutputPanel19 outputpanel19;
    NewGuideOutputPanel20 outputpanel20;
    
    NewGuideGraphCanvasDir rwcca;
    NewGuideGraphCanvasRadRes rwccb;
    NewGuideGraphCanvasRadReac rwccb2;
    NewGuideGraphCanvasInRes rwccd;
    NewGuideGraphCanvasInReac rwccd2;
    NewGuideGraphCanvasF rwccf;
    NewGuideGraphCanvasG rwccg;
    NewGuideGraphCanvasH rwcch;
    NewGuideGraphCanvasH2 rwcch2;
    NewGuideGraphCanvasJ rwccj;
    NewGuideGraphCanvasJ2 rwccj2;
    NewGuideGraphCanvasK rwcck;
    NewGuideGraphCanvasL rwccl;
    NewGuideGraphCanvasM rwccm;
    NewGuideGraphCanvasN rwccn;
    NewGuideGraphCanvasO rwcco;
    NewGuideGraphCanvasP rwccp;
    NewGuideGraphCanvasQ rwccq;
    NewGuideGraphCanvasR rwccr;
    NewGuideGraphCanvasR2 rwccr2;
    NewGuideGraphCanvasR3 rwccr3;
    NewGuideGraphCanvasS rwccs;
    NewGuideGraphCanvasS2 rwccs2;
    NewGuideGraphCanvasS3 rwccs3;
    
    NewGuideGraphCanvasT rwcct;
    NewGuideGraphCanvasU rwccu;
    NewGuideGraphCanvasV rwccv;
    NewGuideGraphCanvasW rwccw;
    
    NewGuideGraphCanvasX rwccx;
    NewGuideGraphCanvasY rwccy;
    
    ControlPanel3D cp3D;
    
    public int xmove = 10;
    public int ymove = 34;
        
    
     /**
     * Initializes the applet.  You never need to call this directly; it is
     * called automatically by the system once the applet is created.
     */
    
    public static void main(String[] args){
        DetailedTwoAntennas f = new DetailedTwoAntennas();
        int xxmove = 20;
        int yymove = 41;
        f.setSize(626+xxmove,573+yymove);
        f.setVisible(true);
        f.setLayout(null);
    }
    
    public DetailedTwoAntennas(){
	setLayout(null);
        String lcOSName = System.getProperty("os.name").toLowerCase();
        boolean MAC_OS_X = lcOSName.startsWith("mac os x");
        boolean PC_OS = lcOSName.startsWith("windows");
        TheFonts.setMAC_OS_X(MAC_OS_X);
        TheFonts.setPC_OS(PC_OS);
        
        // CHANGE ==============================================================
        //int xmove = 10;
        //int ymove = 34;
        //======================================================================
        
	//titlepanel = new TitlePanel("Module 9.6","Detailed Analysis of Two-Dipole Array");
	titlepanel = new TitlePanel("Module 9.6","Detailed Analysis: 2-Dipole Array");
	//add(titlepanel);
	titlepanel.setBounds(10+xmove,9+ymove,300,41);
	
        //about = new About();
        //about.setBounds(9,9,608,552);
	//about.setVisible(false);
        instructions = new Instructions();
        //instructions.setBounds(9,9,608,552);
        instructions.setBounds(11+xmove,261+ymove,604,298);
        //instructions.setVisible(false);
        instrFrame = new Panel();
        instrFrame.setBackground(Color.black);
        instrFrame.setBounds(10+xmove,260+ymove,606,300);
        //instrFrame.setVisible(false);
        
	state = new NewGuide_State();
	
	rwc = new NewGuideCanvas();
	//add(rwc);
	rwc.setBounds(12+xmove,56+ymove,298,198);
	rwc.setVisible(true);
	
	rwc2 = new NewGuideCanvas2();
	//add(rwc2);
        // CHANGE ==============================================================
	//rwc2.setBounds(317+xmove,56+ymove,298,198);
        rwc2.setBounds(317+xmove,56+ymove,296,198);
        //======================================================================
	rwc2.setVisible(true);
    
	inputpanel = new NewGuideInputPanel(state);
	//add(inputpanel);
	inputpanel.setBounds(12+xmove,262+ymove,296,296);
	inputpanel.setVisible(true);
	
	inputpanel2 = new NewGuideInputPanel2(state);
	//add(inputpanel2);
	inputpanel2.setBounds(12+xmove,262+ymove,296,296);
	inputpanel2.setVisible(false);
	
	inputpanel3 = new NewGuideInputPanel3(state);
	//add(inputpanel3);
	inputpanel3.setBounds(12+xmove,262+ymove,296,296);
	inputpanel3.setVisible(false);
	
	rwccq = new NewGuideGraphCanvasQ(state);
	//add(rwccq);
	rwccq.setVisible(false);
	rwccq.setBounds(10+xmove,260+ymove,605,300);
	
	outputpanel = new NewGuideOutputPanel(state, rwc);
	//add(outputpanel);
	outputpanel.setBounds(317+xmove,262+ymove,296,296);
	outputpanel.setVisible(true);
	
	outputpanel2 = new NewGuideOutputPanel2(state);
	//add(outputpanel2);
	outputpanel2.setBounds(12+xmove,262+ymove,296,296);
	outputpanel2.setVisible(false);
	
	outputpanel3 = new NewGuideOutputPanel3(state);
	//add(outputpanel3);
	outputpanel3.setBounds(317+xmove,262+ymove,296,296);
	outputpanel3.setVisible(false);
	
	outputpanel4 = new NewGuideOutputPanel4(state);
	//add(outputpanel4);
	outputpanel4.setBounds(12+xmove,262+ymove,296,296);
	outputpanel4.setVisible(false);
	
	outputpanel5 = new NewGuideOutputPanel5(state);
	//add(outputpanel5);
	outputpanel5.setBounds(317+xmove,262+ymove,296,296);
	outputpanel5.setVisible(false);
	
	outputpanel4b = new NewGuideOutputPanel4b(state);
	//add(outputpanel4b);
	outputpanel4b.setBounds(12+xmove,262+ymove,296,296);
	outputpanel4b.setVisible(false);
	
	outputpanel5b = new NewGuideOutputPanel5b(state);
	//add(outputpanel5b);
	outputpanel5b.setBounds(317+xmove,262+ymove,296,296);
	outputpanel5b.setVisible(false);
	
	outputpanel6 = new NewGuideOutputPanel6(state);
	//add(outputpanel6);
	outputpanel6.setBounds(12+xmove,262+ymove,296,296);
	outputpanel6.setVisible(false);
	
	outputpanel7 = new NewGuideOutputPanel7(state);
	//add(outputpanel7);
	outputpanel7.setBounds(317+xmove,262+ymove,296,296);
	outputpanel7.setVisible(false);
	
	outputpanel8 = new NewGuideOutputPanel8(state);
	//add(outputpanel8);
	outputpanel8.setBounds(12+xmove,262+ymove,296,296);
	outputpanel8.setVisible(false);
	
	outputpanel9 = new NewGuideOutputPanel9(state);
	//add(outputpanel9);
	outputpanel9.setBounds(317+xmove,262+ymove,296,296);
	outputpanel9.setVisible(false);
	
	outputpanel10 = new NewGuideOutputPanel10(state);
	//add(outputpanel10);
	outputpanel10.setBounds(12+xmove,262+ymove,296,296);
	outputpanel10.setVisible(false);
	
	outputpanel11 = new NewGuideOutputPanel11(state);
	//add(outputpanel11);
	outputpanel11.setBounds(317+xmove,262+ymove,296,296);
	outputpanel11.setVisible(false);
	
	outputpanel12 = new NewGuideOutputPanel12(state);
	//add(outputpanel12);
	outputpanel12.setBounds(317+xmove,57+ymove,296,196);
	outputpanel12.setVisible(false);
	
	outputpanel13 = new NewGuideOutputPanel13(state);
	//add(outputpanel13);
	outputpanel13.setBounds(12+xmove,262+ymove,296,296);
	outputpanel13.setVisible(false);
	
	outputpanel14 = new NewGuideOutputPanel14(state);
	//add(outputpanel14);
	outputpanel14.setBounds(317+xmove,262+ymove,296,296);
	outputpanel14.setVisible(false);
	
	outputpanel13b = new NewGuideOutputPanel13b(state);
	//add(outputpanel13b);
	outputpanel13b.setBounds(12+xmove,262+ymove,296,296);
	outputpanel13b.setVisible(false);
	
	outputpanel14b = new NewGuideOutputPanel14b(state);
	//add(outputpanel14b);
	outputpanel14b.setBounds(317+xmove,262+ymove,296,296);
	outputpanel14b.setVisible(false);
	
	outputpanel13c = new NewGuideOutputPanel13c(state);
	//add(outputpanel13c);
	outputpanel13c.setBounds(12+xmove,262+ymove,296,296);
	outputpanel13c.setVisible(false);
	
	outputpanel14c = new NewGuideOutputPanel14c(state);
	//add(outputpanel14c);
	outputpanel14c.setBounds(317+xmove,262+ymove,296,296);
	outputpanel14c.setVisible(false);
	
	outputpanel15 = new NewGuideOutputPanel15(state);
	//add(outputpanel15);
	outputpanel15.setBounds(317+xmove,262+ymove,296,296);
	outputpanel15.setVisible(false);
	
	outputpanel16 = new NewGuideOutputPanel16(state);
	//add(outputpanel16);
	outputpanel16.setBounds(12+xmove,262+ymove,296,296);
	outputpanel16.setVisible(false);
	
	outputpanel17 = new NewGuideOutputPanel17(state);
	//add(outputpanel17);
	outputpanel17.setBounds(317+xmove,262+ymove,296,296);
	outputpanel17.setVisible(false);
	
	outputpanel18 = new NewGuideOutputPanel18(state);
	//add(outputpanel18);
	outputpanel18.setBounds(12+xmove,262+ymove,296,296);
	outputpanel18.setVisible(false);
	
	outputpanel19 = new NewGuideOutputPanel19(state);
	//add(outputpanel19);
	outputpanel19.setBounds(317+xmove,262+ymove,296,296);
	outputpanel19.setVisible(false);
	
	outputpanel20 = new NewGuideOutputPanel20(state);
	//add(outputpanel20);
	outputpanel20.setBounds(12+xmove,262+ymove,296,296);
	outputpanel20.setVisible(false);
	
	frequency_panel = new SetRangePanel("Frequency","[ Hz ]");
	//add(frequency_panel);
	frequency_panel.setBounds(12+xmove,262+ymove,296,296);
	frequency_panel.setVisible(false);
	frequency_panel.setMinimum(state.frequency_minimum);
	frequency_panel.setMaximum(state.frequency_maximum);
	frequency_panel.setBackg(new Color(236,236,221));
	
	a_panel = new SetRangePanel("Dipole A - Length","");
	//add(a_panel);
	a_panel.setBounds(12+xmove,262+ymove,296,296);
	a_panel.setVisible(false);
	a_panel.setMinimum(state.a_minimum);
	a_panel.setMaximum(state.a_maximum);
	a_panel.setBackg(new Color(236,236,221));
	
	a2_panel = new SetRangePanel("Dipole B - Length","");
	//add(a2_panel);
	a2_panel.setBounds(12+xmove,262+ymove,296,296);
	a2_panel.setVisible(false);
	a2_panel.setMinimum(state.a2_minimum);
	a2_panel.setMaximum(state.a2_maximum);
	a2_panel.setBackg(new Color(236,236,221));
	
	current_panel = new SetRangePanel("Dipole A - Maximum Current","[ A ]");
	//add(current_panel);
	current_panel.setBounds(12+xmove,262+ymove,296,296);
	current_panel.setVisible(false);
	current_panel.setMinimum(state.currentin_minimum);
	current_panel.setMaximum(state.currentin_maximum);
	current_panel.setBackg(new Color(236,236,221));
	
	current2_panel = new SetRangePanel("Dipole B - Maximum Current","[ A ]");
	//add(current2_panel);
	current2_panel.setBounds(12+xmove,262+ymove,296,296);
	current2_panel.setVisible(false);
	current2_panel.setMinimum(state.currentin2_minimum);
	current2_panel.setMaximum(state.currentin2_maximum);
	current2_panel.setBackg(new Color(236,236,221));
	
	adist_panel = new SetRangePanel("Dipoles Separation d","");
	//add(adist_panel);
	adist_panel.setBounds(12+xmove,262+ymove,296,296);
	adist_panel.setVisible(false);
	adist_panel.setMinimum(state.antenna_distance_minimum);
	adist_panel.setMaximum(state.antenna_distance_maximum);
	adist_panel.setBackg(new Color(236,236,221));
	
	distance_panel = new SetRangePanel("Radial Distance r","");
	//add(distance_panel);
	distance_panel.setBounds(12+xmove,262+ymove,296,296);
	distance_panel.setVisible(false);
	distance_panel.setMinimum(state.distance_minimum);
	distance_panel.setMaximum(state.distance_maximum);
	distance_panel.setBackg(new Color(236,236,221));
		
	rwconp = new NewGuideControlPanel();
	//add(rwconp);
	rwconp.setBounds(317+xmove,12+ymove,296,36);
	
	cp3D = new ControlPanel3D(state);
	//add(cp3D);
	cp3D.setVisible(false);
	cp3D.setBounds(317+xmove,57+ymove,296,196);
	
	rwcca = new NewGuideGraphCanvasDir(state);
	//add(rwcca);
	rwcca.setVisible(false);
	rwcca.setBounds(317+xmove,57+ymove,296,196);
	
	rwccb = new NewGuideGraphCanvasRadRes(state);
	//add(rwccb);
	rwccb.setVisible(false);
	rwccb.setBounds(317+xmove,57+ymove,296,196);
	
	rwccb2 = new NewGuideGraphCanvasRadReac(state);
	//add(rwccb2);
	rwccb2.setVisible(false);
	rwccb2.setBounds(317+xmove,57+ymove,296,196);
	
	rwccd = new NewGuideGraphCanvasInRes(state);
	//add(rwccd);
	rwccd.setVisible(false);
	rwccd.setBounds(317+xmove,57+ymove,296,196);
	
	rwccd2 = new NewGuideGraphCanvasInReac(state);
	//add(rwccd2);
	rwccd2.setVisible(false);
	rwccd2.setBounds(317+xmove,57+ymove,296,196);
		
	rwccf = new NewGuideGraphCanvasF(state);
	//add(rwccf);
	rwccf.setVisible(false);
	rwccf.setBounds(12+xmove,262+ymove,296,296);
	
	rwccg = new NewGuideGraphCanvasG(state);
	//add(rwccg);
	rwccg.setVisible(false);
	rwccg.setBounds(317+xmove,262+ymove,296,296);
	
	rwcch = new NewGuideGraphCanvasH(state);
	//add(rwcch);
	rwcch.setVisible(false);
	rwcch.setBounds(12+xmove,262+ymove,296,296);
	
	rwcch2 = new NewGuideGraphCanvasH2(state);
	//add(rwcch2);
	rwcch2.setVisible(false);
	rwcch2.setBounds(12+xmove,262+ymove,296,296);
	
	rwccj = new NewGuideGraphCanvasJ(state);
	//add(rwccj);
	rwccj.setVisible(false);
	rwccj.setBounds(317+xmove,262+ymove,296,296);
	
	rwccj2 = new NewGuideGraphCanvasJ2(state);
	//add(rwccj2);
	rwccj2.setVisible(false);
	rwccj2.setBounds(317+xmove,262+ymove,296,296);
	
	rwcck = new NewGuideGraphCanvasK(state);
	//add(rwcck);
	rwcck.setVisible(false);
	rwcck.setBounds(12+xmove,262+ymove,296,296);
	
	rwccl = new NewGuideGraphCanvasL(state);
	//add(rwccl);
	rwccl.setVisible(false);
	rwccl.setBounds(12+xmove,262+ymove,296,296);
	
	rwccm = new NewGuideGraphCanvasM(state);
	//add(rwccm);
	rwccm.setVisible(false);
	rwccm.setBounds(12+xmove,262+ymove,296,296);
	
	rwccn = new NewGuideGraphCanvasN(state);
	//add(rwccn);
	rwccn.setVisible(false);
	rwccn.setBounds(317+xmove,262+ymove,296,296);
	
	rwcco = new NewGuideGraphCanvasO(state);
	//add(rwcco);
	rwcco.setVisible(false);
	rwcco.setBounds(317+xmove,262+ymove,296,296);
	
	rwccp = new NewGuideGraphCanvasP(state);
	//add(rwccp);
	rwccp.setVisible(false);
	rwccp.setBounds(317+xmove,262+ymove,296,296);
	
	rwccr = new NewGuideGraphCanvasR(state);
	//add(rwccr);
	rwccr.setVisible(false);
	rwccr.setBounds(12+xmove,262+ymove,296,296);
	
	rwccs = new NewGuideGraphCanvasS(state);
	//add(rwccs);
	rwccs.setVisible(false);
	rwccs.setBounds(317+xmove,262+ymove,296,296);
	
	rwccr2 = new NewGuideGraphCanvasR2(state);
	//add(rwccr2);
	rwccr2.setVisible(false);
	rwccr2.setBounds(12+xmove,262+ymove,296,296);
	
	rwccs2 = new NewGuideGraphCanvasS2(state);
	//add(rwccs2);
	rwccs2.setVisible(false);
	rwccs2.setBounds(317+xmove,262+ymove,296,296);
	
	rwccr3 = new NewGuideGraphCanvasR3(state);
	//add(rwccr3);
	rwccr3.setVisible(false);
	rwccr3.setBounds(12+xmove,262+ymove,296,296);
	
	rwccs3 = new NewGuideGraphCanvasS3(state);
	//add(rwccs3);
	rwccs3.setVisible(false);
	rwccs3.setBounds(317+xmove,262+ymove,296,296);
	
	rwcct = new NewGuideGraphCanvasT(state);
	//add(rwcct);
	rwcct.setVisible(false);
	rwcct.setBounds(12+xmove,262+ymove,296,296);
	
	rwccu = new NewGuideGraphCanvasU(state);
	//add(rwccu);
	rwccu.setVisible(false);
	rwccu.setBounds(317+xmove,262+ymove,296,296);
	
	rwccv = new NewGuideGraphCanvasV(state);
	//add(rwccv);
	rwccv.setVisible(false);
	rwccv.setBounds(12+xmove,262+ymove,296,296);
	
	rwccw = new NewGuideGraphCanvasW(state);
	//add(rwccw);
	rwccw.setVisible(false);
	rwccw.setBounds(317+xmove,262+ymove,296,296);
	
	rwccx = new NewGuideGraphCanvasX(state);
	//add(rwccx);
	rwccx.setVisible(false);
	rwccx.setBounds(12+xmove,262+ymove,296,296);
	
	rwccy = new NewGuideGraphCanvasY(state);
	//add(rwccy);
	rwccy.setVisible(false);
	rwccy.setBounds(317+xmove,262+ymove,296,296);
		
	Panel p01 = new Panel();
	    p01.setBackground(Color.white);
	    //add(p01);
	    p01.setBounds(11+xmove,56+ymove,298,198);
	
	Panel p1 = new Panel();
	    p1.setBackground(Color.black);
	    //add(p1);
	    p1.setBounds(10+xmove,55+ymove,300,200);
	    
	//backpanels for output panel
	Panel p20 = new Panel();
	    p20.setBackground(Color.white);
	    //add(p20);
	    p20.setBounds(316+xmove,261+ymove,298,298);
    
	Panel p2 = new Panel();
	    p2.setBackground(Color.black);
	    //add(p2);
	    p2.setBounds(315+xmove,260+ymove,300,300);
	    
	//backpanels for control panel
	Panel p40 = new Panel();
	    p40.setBackground(Color.white);
	    //add(p40);
	    p40.setBounds(316+xmove,11+ymove,298,38);
    
	Panel p4 = new Panel();
	    p4.setBackground(Color.black);
	    //add(p4);
	    p4.setBounds(315+xmove,10+ymove,300,40);
	
	//backpanels for inputpanel        
	Panel p50 = new Panel();
	    p50.setBackground(Color.white);
	    //add(p50);
	    p50.setBounds(11+xmove,261+ymove,298,298);
    
	Panel p5 = new Panel();
	    p5.setBackground(Color.black);
	    //add(p5);
	    p5.setBounds(10+xmove,260+ymove,300,300);
	//backpanel for cp3D  
	Panel p60 = new Panel();
	    p60.setBackground(Color.white);
	    //add(p60);
	    p60.setBounds(316+xmove,56+ymove,298,198);
	Panel p6 = new Panel();
	    p6.setBackground(Color.black);
	    //add(p6);
	    p6.setBounds(315+xmove,55+ymove,300,200);
	

	//backpanels for applet
	Panel p0 = new Panel();
	    p0.setBackground(Color.cyan);
	    //add(p0);
	    p0.setBounds(3+xmove,3+ymove,620,564);
	    
	Panel p00 = new Panel();
	    p00.setBackground(Color.black);
	    //add(p00);
	    p00.setBounds(xmove,ymove,626,570);
    
            //if(state.this_year > line.magicyear || (state.this_year == line.magicyear && state.this_month > line.magicmonth)){
            //    state.LicenseExpired = true;
            //}
            //else
            //{ 	    
	    //add(about);
            add(instructions);
            add(instrFrame);
	    add(titlepanel);
	    add(rwc);
	    add(rwc2);
	    add(inputpanel);
	    add(inputpanel2);
	    add(inputpanel3);
	    add(rwccq);
	    add(outputpanel);
	    add(outputpanel2);
	    add(outputpanel3);
	    add(outputpanel4);
	    add(outputpanel5);
	    add(outputpanel4b);
	    add(outputpanel5b);
	    add(outputpanel6);
	    add(outputpanel7);
	    add(outputpanel8);
	    add(outputpanel9);
	    add(outputpanel10);
	    add(outputpanel11);
	    add(outputpanel12);
	    add(outputpanel13);
	    add(outputpanel14);
	    add(outputpanel13b);
	    add(outputpanel14b);
	    add(outputpanel13c);
	    add(outputpanel14c);
	    add(outputpanel15);
	    add(outputpanel16);
	    add(outputpanel17);
	    add(outputpanel18);
	    add(outputpanel19);
	    add(outputpanel20);
	    add(frequency_panel);
	    add(a_panel);
	    add(a2_panel);
	    add(current_panel);
	    add(current2_panel);
	    add(adist_panel);
	    add(distance_panel);
	    add(rwconp);
	    add(cp3D);
	    add(rwcca);
	    add(rwccb);
	    add(rwccb2);
	    add(rwccd);
	    add(rwccd2);
	    add(rwccf);
	    add(rwccg);
	    add(rwcch);
	    add(rwcch2);
	    add(rwccj);
	    add(rwccj2);
	    add(rwcck);
	    add(rwccl);
	    add(rwccm);
	    add(rwccn);
	    add(rwcco);
	    add(rwccp);
	    add(rwccr);
	    add(rwccs);
	    add(rwccr2);
	    add(rwccs2);
	    add(rwccr3);
	    add(rwccs3);
	    add(rwcct);
	    add(rwccu);
	    add(rwccv);
	    add(rwccw);
	    add(rwccx);
	    add(rwccy);
	    add(p01);
	    add(p1);
	    add(p20);
	    add(p2);
	    add(p40);
	    add(p4);
	    add(p50);
	    add(p5);
	    add(p60);
	    add(p6);
	    add(p0);
	    add(p00);
	    
	    state.LicenseExpired = false; 	
            //}

	//Listeners
        this.addWindowListener(this);
        instructions.bupdate.addActionListener(this);
            
	rwconp.ch1.addItemListener(this);
	rwconp.ch2.addItemListener(this);
	
	cp3D.ch1.addItemListener(this);
	cp3D.ch2.addItemListener(this);
	cp3D.ch3.addItemListener(this);
	cp3D.ch4.addItemListener(this);
	cp3D.ch5.addItemListener(this);
	cp3D.ch6.addItemListener(this);
	cp3D.cg1.addItemListener(this);
	cp3D.cg2.addItemListener(this);
	cp3D.cg3.addItemListener(this);
	cp3D.cg4.addItemListener(this);
	cp3D.cg5.addItemListener(this);
	cp3D.cg6.addItemListener(this);
	
	cp3D.cplot1.addItemListener(this);
	cp3D.cplot2.addItemListener(this);
	cp3D.cplot3.addItemListener(this);
	cp3D.slider1.addAdjustmentListener(this);
	cp3D.bupdate.addActionListener(this);
	
	inputpanel.ch2.addItemListener(this);
	inputpanel.b1.addActionListener(this);
	inputpanel.b2.addActionListener(this);
	inputpanel.b3.addActionListener(this);
	inputpanel2.b2.addActionListener(this);
	
	inputpanel3.ch2.addItemListener(this);
	inputpanel3.b1.addActionListener(this);
	inputpanel3.b2.addActionListener(this);
	inputpanel3.b3.addActionListener(this);
	outputpanel.rwocField.addMouseListener(this);
	
	outputpanel12.ch1.addItemListener(this);
	outputpanel12.ch2.addItemListener(this);
			
	inputpanel.slider1.addAdjustmentListener(this);
	inputpanel.slider2.addAdjustmentListener(this);
	inputpanel.slider3.addAdjustmentListener(this);
	inputpanel2.slider1.addAdjustmentListener(this);
	inputpanel2.slider2.addAdjustmentListener(this);
	inputpanel2.slider3.addAdjustmentListener(this);
	inputpanel2.slider10.addAdjustmentListener(this);
	inputpanel2.slider30.addAdjustmentListener(this);
	inputpanel3.slider1.addAdjustmentListener(this);
	inputpanel3.slider2.addAdjustmentListener(this);
	inputpanel3.slider3.addAdjustmentListener(this);
	inputpanel3.slider4.addAdjustmentListener(this);
	
	inputpanel.bupdate.addActionListener(this);
	inputpanel2.bupdate.addActionListener(this);
	inputpanel3.bupdate.addActionListener(this);
	
	a_panel.b1.addActionListener(this);
	a2_panel.b1.addActionListener(this);
	adist_panel.b1.addActionListener(this);
	frequency_panel.b1.addActionListener(this);
	current_panel.b1.addActionListener(this);
	current2_panel.b1.addActionListener(this);
	distance_panel.b1.addActionListener(this);
	
	state.ignition();
	rwccq.repaint();
    }
    /*
    public void paint(Graphics g){
    
	Font licensefont = new Font("SanSerif",Font.BOLD,18); 	
	g.setColor(Color.white);	 	
	g.fillRect(0,0,945,765); 	
		
	if(state.LicenseExpired){
	    g.setFont(licensefont);
	
	    g.setColor(Color.red);
	    g.drawString("The software license has expired.", 50, 200);
	    g.setColor(Color.black);
	    g.drawString("Obtain updated files from www.amanogawa.com", 50, 230);
	} 
    }
    */
    
    public void paint(Graphics g){
    
    Font licensefont = new Font("SanSerif",Font.BOLD,18); 
    Font fonto = new Font("SanSerif",Font.PLAIN,12);
    Font fontc = new Font("SanSerif",Font.BOLD,16);
    
	Graphics2D g2d = (Graphics2D)g;
        //g.setColor(Color.white);	
	//g.fillRect(0,0,626,600);  	
	/*	
	if(state.LicenseExpired){
	    g.setFont(licensefont);
	
	    g.setColor(Color.red);
	    g.drawString("The software license has expired.", 50, 200);
	    g.setColor(Color.black);
	    g.drawString("Obtain updated files from www.amanogawa.com", 50, 230);
	} 
        
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
        int annonuovo = 2006;
        int anno = 2006;
        
        if(anno > state.this_year){
            annonuovo = anno;
        }
        else{
            annonuovo = state.this_year;
        }
        */
        //g.setColor(Color.red.darker());
        //g.setFont(fontc);
        //g.drawString("\u00a9",10,587);
        //g.setFont(fonto);
        //g.drawString("Amanogawa, "+annonuovo+" - All Rights Reserved",30,585);
    }
    
    public void adjustmentValueChanged(AdjustmentEvent evt){
	
	
        if(evt.getSource()==inputpanel.slider1 || evt.getSource()==inputpanel.slider2 || evt.getSource()==inputpanel.slider3){
            state.need_update = true;
            /*
            state.ignition();
	    //state.scan_coefficients();
	    state.scanCurrent();
	    curlab();
		
	    rwccq.ignition();
	    rwccq.repaint();
	    
	    rwcca.setYRangeMax(state.DVMax);
	    rwcca.setYRangeMin(0.0);
	    rwcca.plotZeroLine(false);
	    rwcca.plotRefPoint(true);
	    rwcca.setLabels("Directivity","","Dipole Length L","");
	    rwcca.setRefPoint(state.a);
	    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
	    rwcca.ignition();
	    rwcca.repaint();
		    
	    rwccb.setYRangeMax(state.RVMax);
	    rwccb.setYRangeMin(0.0);
	    rwccb.plotZeroLine(false);
	    rwccb.plotRefPoint(true);
	    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
	    rwccb.setRefPoint(state.a);
	    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
	    rwccb.ignition();
	    rwccb.repaint();
	    
	    rwccb2.setYRangeMax(state.XVMax);
	    rwccb2.setYRangeMin(state.XVMin);
	    rwccb2.plotZeroLine(true);
	    rwccb2.plotRefPoint(true);
	    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
	    rwccb2.setRefPoint(state.a);
	    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
	    rwccb2.ignition();
	    rwccb2.repaint();
	    
	    rwccd.setYRangeMax(state.RinVMax);
	    rwccd.setYRangeMin(0.0);
	    rwccd.plotZeroLine(false);
	    rwccd.plotRefPoint(true);
	    rwccd.setLabels("Input Resistance","","Dipole Length L","");
	    rwccd.setRefPoint(state.a);
	    rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
	    rwccd.ignition();
	    rwccd.repaint();
	    
	    rwccd2.setYRangeMax(state.XinVMax);
	    rwccd2.setYRangeMin(state.XinVMin);
	    rwccd2.plotZeroLine(true);
	    rwccd2.plotRefPoint(true);
	    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
	    rwccd2.setRefPoint(state.a);
	    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
	    rwccd2.ignition();
	    rwccd2.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    rwc.setField(state.IsEfield);
	    //rwc.setAntennaDistance(state.antenna_distance_lambda);
	    //rwc.setAntennaPhase(state.antenna_phase_degree);
	    
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
	    
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	    
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
            */
        }
	
        else if(evt.getSource()==inputpanel2.slider1 || evt.getSource()==inputpanel2.slider3 || evt.getSource()==inputpanel2.slider10 || evt.getSource()==inputpanel2.slider30){
	    state.ignition();
            state.need_update = true;
            
            //state.scan_coefficients();
	    
            /*
            state.scanCurrent();
	    
	    cp3D.slider1.setValue((int)(state.phi_angle));
	    cp3D.repaint();
	    
	    curlab();
	    
	    rwccq.ignition();
	    rwccq.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    //rwc.setAntennaDistance(state.antenna_distance_lambda);
	    //rwc.setAntennaPhase(state.antenna_phase_degree);
	    */
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
	    
	    //rwc.setField(state.IsEfield);
	    //rwc.repaint();
	    rwc2.repaint();
	    /*
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    cp3D.text3.setText(""+state.point_distance);
	    cp3D.repaint();
             */
    	}
	        
        
        else if(evt.getSource()==inputpanel2.slider2){
            state.need_update = true;
            /*
            state.ignition();
	    //state.scan_coefficients();
	    state.scanCurrent();
	    
	    cp3D.slider1.setValue((int)(state.phi_angle));
	    cp3D.repaint();
	    
	    curlab();
	    
	    rwccq.ignition();
	    rwccq.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    //rwc.setAntennaDistance(state.antenna_distance_lambda);
	    //rwc.setAntennaPhase(state.antenna_phase_degree);
	    
             */
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
	    
	    //rwc.setField(state.IsEfield);
	    //rwc.repaint();
	    rwc2.repaint();
	    /*
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    cp3D.text3.setText(""+state.point_distance);
	    cp3D.repaint();
            state.need_update = true;
            */
        }
	
        
        else if(evt.getSource()==inputpanel3.slider1 || evt.getSource()==inputpanel3.slider2){
	    state.need_update = true;
            /*
            state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
	    
	    cp3D.slider1.setValue((int)(state.phi_angle));
	    cp3D.repaint();
	    
	    curlab();
	    
	    rwccq.ignition();
	    rwccq.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    rwc.setAntennaDistance(state.antenna_distance_lambda);
	    rwc.setAntennaPhase(state.antenna_phase_degree);
	    
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
	    
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	    
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    cp3D.text3.setText(""+state.point_distance);
	    cp3D.repaint();
             */
    	}
	
	
	if(evt.getSource()==cp3D.slider1){
	    
	    //state.ignition();
	    //state.ignition();
	    /*
		    rwccf.ignition();
		    rwccf.repaint();
		    rwccg.ignition();
		    rwccg.repaint();
		    rwcch.ignition();
		    rwcch.repaint();
		    rwcch2.ignition();
		    rwcch2.repaint();
		    rwccj.ignition();
		    rwccj.repaint();
		    rwccj2.ignition();
		    rwccj2.repaint();
		    rwcck.ignition();
		    rwcck.repaint();
		    rwccl.ignition();
		    rwccl.repaint();
		    rwccm.ignition();
		    rwccm.repaint();
		    rwccn.ignition();
		    rwccn.repaint();
		    rwcco.ignition();
		    rwcco.repaint();
		    rwccp.ignition();
		    rwccp.repaint();
		    rwccr.ignition();
		    rwccr.repaint();
		    rwccs.ignition();
		    rwccs.repaint();
		    rwcct.ignition();
		    rwcct.repaint();
		    rwccu.ignition();
		    rwccu.repaint();
		    rwccv.ignition();
		    rwccv.repaint();
		    rwccw.ignition();
		    rwccw.repaint();
		    rwccx.ignition();
		    rwccx.repaint();
		    rwccy.ignition();
		    rwccy.repaint();
		*/    
		    cp3D.repaint();
	}
    }
    
    public void mouseClicked(MouseEvent evt){ }
    public void mouseEntered(MouseEvent evt){ }
    public void mouseExited(MouseEvent evt) { }
    public void mouseReleased(MouseEvent evt) { }
    public void mousePressed(MouseEvent evt) {
	
    }
    
    public void windowClosing(WindowEvent e) {
        dispose();
        System.exit(0);
    }
    
    public void windowOpened(WindowEvent evt){}
    
    public void windowIconified(WindowEvent evt){}
    
    public void windowClosed(WindowEvent evt){}
    
    public void windowDeiconified(WindowEvent evt){}
    
    public void windowActivated(WindowEvent evt){}
    
    public void windowDeactivated(WindowEvent evt){}

    public void actionPerformed(ActionEvent evt){
        //if(evt.getSource()==about.bupdate){
            
        if (evt.getSource()==instructions.bupdate) {
                //about.setVisible(false);
                instructions.setVisible(false);
                instrFrame.setVisible(false);
                if(state.ShowWhich == 1){
                    rwconp.ch2.select(" Set Antenna Parameters");
                }
                else if(state.ShowWhich == 2){
                    rwconp.ch2.select(" Set Array Parameters");
                }
                else if(state.ShowWhich == 3){
                    rwconp.ch2.select(" Scan Fields and Power");
                }
                else if(state.ShowWhich == 4){
                    rwconp.ch2.select(" Plot Current Distribution");
                }
                else if(state.ShowWhich == 5){
                    rwconp.ch2.select(" Plot Field Distribution");
                }
                
        }
        
	if(evt.getSource()==inputpanel.bupdate){
	    //state.need_update = false;
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
		
	    curlab();
	    
	    rwccq.ignition();
	    rwccq.repaint();
	   
	    rwcca.setYRangeMax(state.DVMax);
	    rwcca.setYRangeMin(0.0);
	    rwcca.plotZeroLine(false);
	    rwcca.plotRefPoint(true);
	    rwcca.setLabels("Directivity","","Dipole Length L","");
	    rwcca.setRefPoint(state.a);
	    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
	    rwcca.ignition();
	    rwcca.repaint();
		    
	    rwccb.setYRangeMax(state.RVMax);
	    rwccb.setYRangeMin(0.0);
	    rwccb.plotZeroLine(false);
	    rwccb.plotRefPoint(true);
	    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
	    rwccb.setRefPoint(state.a);
	    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
	    rwccb.ignition();
	    rwccb.repaint();
	    
	    rwccb2.setYRangeMax(state.XVMax);
	    rwccb2.setYRangeMin(state.XVMin);
	    rwccb2.plotZeroLine(true);
	    rwccb2.plotRefPoint(true);
	    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
	    rwccb2.setRefPoint(state.a);
	    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
	    rwccb2.setWireRadius(state.wire_radius);
	    rwccb2.ignition();
	    rwccb2.repaint();
	    
	    rwccd.setYRangeMax(state.RinVMax);
	    rwccd.setYRangeMin(0.0);
	    rwccd.plotZeroLine(false);
	    rwccd.plotRefPoint(true);
	    rwccd.setLabels("Input Resistance","","Dipole Length L","");
	    rwccd.setRefPoint(state.a);
	    rwccd.plot(state.leng,state.RinVector,state.RVector, state.IsDirectivity);
	    rwccd.ignition();
	    rwccd.repaint();
	    
	    rwccd2.setYRangeMax(state.XinVMax);
	    rwccd2.setYRangeMin(state.XinVMin);
	    rwccd2.plotZeroLine(true);
	    rwccd2.plotRefPoint(true);
	    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
	    rwccd2.setRefPoint(state.a);
	    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
	    rwccd2.setWireRadius(state.wire_radius);
	    rwccd2.ignition();
	    rwccd2.repaint();
	   
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    //rwc.setAntennaDistance(state.antenna_distance_lambda);
	    //rwc.setAntennaPhase(state.antenna_phase_degree);
	    
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
	    
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
    	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	}
	
	else if(evt.getSource()==inputpanel2.bupdate){
	    state.need_update = false;
	    state.ignition();
	    //state.scan_coefficients();
	    state.scanCurrent();
		
	    curlab();
	    
	    rwccq.ignition();
	    rwccq.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    //rwc.setAntennaDistance(state.antenna_distance_lambda);
	    //rwc.setAntennaPhase(state.antenna_phase_degree);
	    
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
    
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
    	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    cp3D.slider1.setValue((int)(state.phi_angle));	    
	    cp3D.text3.setText(""+state.point_distance);
	    cp3D.repaint();
	}
	
	if(evt.getSource()==inputpanel3.bupdate){
	    //state.need_update = false;
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
		
	    curlab();
	    
	    rwccq.ignition();
	    rwccq.repaint();
	   
	    rwcca.setYRangeMax(state.DVMax);
	    rwcca.setYRangeMin(0.0);
	    rwcca.plotZeroLine(false);
	    rwcca.plotRefPoint(true);
	    rwcca.setLabels("Directivity","","Dipole Length L","");
	    rwcca.setRefPoint(state.a);
	    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
	    rwcca.ignition();
	    rwcca.repaint();
		    
	    rwccb.setYRangeMax(state.RVMax);
	    rwccb.setYRangeMin(0.0);
	    rwccb.plotZeroLine(false);
	    rwccb.plotRefPoint(true);
	    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
	    rwccb.setRefPoint(state.a);
	    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
	    rwccb.ignition();
	    rwccb.repaint();
	    
	    rwccb2.setYRangeMax(state.XVMax);
	    rwccb2.setYRangeMin(state.XVMin);
	    rwccb2.plotZeroLine(true);
	    rwccb2.plotRefPoint(true);
	    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
	    rwccb2.setRefPoint(state.a);
	    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
	    rwccb2.setWireRadius(state.wire_radius);
	    rwccb2.ignition();
	    rwccb2.repaint();
	    
	    rwccd.setYRangeMax(state.RinVMax);
	    rwccd.setYRangeMin(0.0);
	    rwccd.plotZeroLine(false);
	    rwccd.plotRefPoint(true);
	    rwccd.setLabels("Input Resistance","","Dipole Length L","");
	    rwccd.setRefPoint(state.a);
	    rwccd.plot(state.leng,state.RinVector,state.RVector, state.IsDirectivity);
	    rwccd.ignition();
	    rwccd.repaint();
	    
	    rwccd2.setYRangeMax(state.XinVMax);
	    rwccd2.setYRangeMin(state.XinVMin);
	    rwccd2.plotZeroLine(true);
	    rwccd2.plotRefPoint(true);
	    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
	    rwccd2.setRefPoint(state.a);
	    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
	    rwccd2.setWireRadius(state.wire_radius);
	    rwccd2.ignition();
	    rwccd2.repaint();
	   
	    rwc.setFrequency(state.frequency);
	    rwc.setEpsilon(state.epsilon_r);
	    rwc.setAntennaLength(state.DipoleLength_lambda);
	    rwc.setAntennaLength2(state.DipoleLength2_lambda);
	    rwc.setAntennaRadius(state.wire_radius);
	    rwc.setAntennaDistance(state.antenna_distance_lambda);
	    rwc.setAntennaPhase(state.antenna_phase_degree);
	    
	    rwc2.setFrequency(state.frequency);
	    rwc2.setEpsilon(state.epsilon_r);
	    rwc2.setWavelength(state.wavelength);
	    rwc2.setTheta(state.theta_angle);
	    rwc2.setPhi(state.phi_angle);
	    rwc2.setDistance(state.point_distance);
	    
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
    	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	}
	
	 else if(evt.getSource()==cp3D.bupdate){
	    try{
		if(Double.valueOf(cp3D.text3.getText()).doubleValue()>=0.0 && 
		   Double.valueOf(cp3D.text3.getText()).doubleValue()<=state.distance_maximum){
		    state.point_distance=Double.valueOf(cp3D.text3.getText()).doubleValue();
		    state.distance = state.point_distance * state.wavelength;
		}
		else if(Double.valueOf(cp3D.text3.getText()).doubleValue()>state.distance_maximum){
		    state.point_distance=state.distance_maximum;
		    state.distance = state.point_distance * state.wavelength;
		    cp3D.text3.setText(""+state.point_distance);
		}
		else{
		    state.point_distance=0.0;
		    state.distance=0.0;
		    cp3D.text3.setText(""+state.point_distance);
		}
	    } 
	    catch(NumberFormatException e){
		  state.point_distance = 0.0;
	    }
	    
	    state.phi_angle = cp3D.slider1.getValue();
	    inputpanel2.slider3.setValue((int)(inputpanel2.ScrollMax2*(state.phi_angle-state.phi_minimum)/
					    (state.phi_maximum-state.phi_minimum)));
	    inputpanel2.slider30.setValue(0);
	    inputpanel2.text2.setText(""+MaestroA.rounder(state.phi_angle,7));
	    
		    state.ignition();
		    state.scan3Dfield();
		    
		    rwccf.setYRangeMax(state.EfieldMax);
		    rwccf.setYRangeMin(0.0);
		    rwccf.plotZeroLine(false);
		    rwccf.plotRefPoint(false);
		    rwccf.setPolar(state.IsPolar);
		    rwccf.setPhiAngle((int)state.phi_angle);
		    rwccf.setType(1);
		    rwccf.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    rwccg.setYRangeMax(state.EfieldphiMax);
		    rwccg.setYRangeMin(0.0);
		    rwccg.plotZeroLine(false);
		    rwccg.plotRefPoint(false);
		    rwccg.setPolar(state.IsPolar);
		    rwccg.setPhiAngle((int)state.phi_angle);
		    rwccg.setType(1);
		    rwccg.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcch.setYRangeMax(state.EfieldRadMax);
		    rwcch.setYRangeMin(0.0);
		    rwcch.plotZeroLine(false);
		    rwcch.plotRefPoint(false);
		    rwcch.setPolar(state.IsPolar);
		    rwcch.setPhiAngle((int)state.phi_angle);
		    rwcch.setType(2);
		    rwcch.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccj.setYRangeMax(state.EfieldphiRadMax);
		    rwccj.setYRangeMin(0.0);
		    rwccj.plotZeroLine(false);
		    rwccj.plotRefPoint(false);
		    rwccj.setPolar(state.IsPolar);
		    rwccj.setPhiAngle((int)state.phi_angle);
		    rwccj.setType(2);
		    rwccj.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcch2.setYRangeMax(state.EfieldPhigenMax);
		    rwcch2.setYRangeMin(0.0);
		    rwcch2.plotZeroLine(false);
		    rwcch2.plotRefPoint(false);
		    rwcch2.setPolar(state.IsPolar);
		    rwcch2.setPhiAngle((int)state.phi_angle);
		    rwcch2.setType(10);
		    rwcch2.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		   		    
		    rwccj2.setYRangeMax(state.EfieldphiPhiMax);
		    rwccj2.setYRangeMin(0.0);
		    rwccj2.plotZeroLine(false);
		    rwccj2.plotRefPoint(false);
		    rwccj2.setPolar(state.IsPolar);
		    rwccj2.setPhiAngle((int)state.phi_angle);
		    rwccj2.setType(10);
		    rwccj2.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcck.setYRangeMax(state.EfieldCartxMax);
		    rwcck.setYRangeMin(0.0);
		    rwcck.plotZeroLine(false);
		    rwcck.plotRefPoint(false);
		    rwcck.setPolar(state.IsPolar);
		    rwcck.setPhiAngle((int)state.phi_angle);
		    rwcck.setType(3);
		    rwcck.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccl.setYRangeMax(state.EfieldCartyMax);
		    rwccl.setYRangeMin(0.0);
		    rwccl.plotZeroLine(false);
		    rwccl.plotRefPoint(false);
		    rwccl.setPolar(state.IsPolar);
		    rwccl.setPhiAngle((int)state.phi_angle);
		    rwccl.setType(4);
		    rwccl.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccm.setYRangeMax(state.EfieldCartzMax);
		    rwccm.setYRangeMin(0.0);
		    rwccm.plotZeroLine(false);
		    rwccm.plotRefPoint(false);
		    rwccm.setPolar(state.IsPolar);
		    rwccm.setPhiAngle((int)state.phi_angle);
		    rwccm.setType(5);
		    rwccm.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccn.setYRangeMax(state.EfieldCart2xMax);
		    rwccn.setYRangeMin(0.0);
		    rwccn.plotZeroLine(false);
		    rwccn.plotRefPoint(false);
		    rwccn.setPolar(state.IsPolar);
		    rwccn.setPhiAngle((int)state.phi_angle);
		    rwccn.setType(3);
		    rwccn.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcco.setYRangeMax(state.EfieldCart2yMax);
		    rwcco.setYRangeMin(0.0);
		    rwcco.plotZeroLine(false);
		    rwcco.plotRefPoint(false);
		    rwcco.setPolar(state.IsPolar);
		    rwcco.setPhiAngle((int)state.phi_angle);
		    rwcco.setType(4);
		    rwcco.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccp.setYRangeMax(state.EfieldCart2zMax);
		    rwccp.setYRangeMin(0.0);
		    rwccp.plotZeroLine(false);
		    rwccp.plotRefPoint(false);
		    rwccp.setPolar(state.IsPolar);
		    rwccp.setPhiAngle((int)state.phi_angle);
		    rwccp.setType(5);
		    rwccp.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccr.setYRangeMax(state.HfieldMax);
		    rwccr.setYRangeMin(0.0);
		    rwccr.plotZeroLine(false);
		    rwccr.plotRefPoint(false);
		    rwccr.setPolar(state.IsPolar);
		    rwccr.setPhiAngle((int)state.phi_angle);
		    rwccr.setType(6);
		    rwccr.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccr2.setYRangeMax(state.HfieldRadMax);
		    rwccr2.setYRangeMin(0.0);
		    rwccr2.plotZeroLine(false);
		    rwccr2.plotRefPoint(false);
		    rwccr2.setPolar(state.IsPolar);
		    rwccr2.setPhiAngle((int)state.phi_angle);
		    rwccr2.setType(11);
		    rwccr2.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccr3.setYRangeMax(state.HfieldThetaMax);
		    rwccr3.setYRangeMin(0.0);
		    rwccr3.plotZeroLine(false);
		    rwccr3.plotRefPoint(false);
		    rwccr3.setPolar(state.IsPolar);
		    rwccr3.setPhiAngle((int)state.phi_angle);
		    rwccr3.setType(12);
		    rwccr3.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccs.setYRangeMax(state.HfieldphiMax);
		    rwccs.setYRangeMin(0.0);
		    rwccs.plotZeroLine(false);
		    rwccs.plotRefPoint(false);
		    rwccs.setPolar(state.IsPolar);
		    rwccs.setPhiAngle((int)state.phi_angle);
		    rwccs.setType(6);
		    rwccs.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccs2.setYRangeMax(state.HfieldphiRadMax);
		    rwccs2.setYRangeMin(0.0);
		    rwccs2.plotZeroLine(false);
		    rwccs2.plotRefPoint(false);
		    rwccs2.setPolar(state.IsPolar);
		    rwccs2.setPhiAngle((int)state.phi_angle);
		    rwccs2.setType(11);
		    rwccs2.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccs3.setYRangeMax(state.HfieldphiThetaMax);
		    rwccs3.setYRangeMin(0.0);
		    rwccs3.plotZeroLine(false);
		    rwccs3.plotRefPoint(false);
		    rwccs3.setPolar(state.IsPolar);
		    rwccs3.setPhiAngle((int)state.phi_angle);
		    rwccs3.setType(12);
		    rwccs3.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    
		    //-------------------------------------------  new: H cartesian components
		    rwcct.setYRangeMax(state.HfieldCartxMax);
		    rwcct.setYRangeMin(0.0);
		    rwcct.plotZeroLine(false);
		    rwcct.plotRefPoint(false);
		    rwcct.setPolar(state.IsPolar);
		    rwcct.setPhiAngle((int)state.phi_angle);
		    rwcct.setType(7);
		    rwcct.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccu.setYRangeMax(state.HfieldCart2xMax);
		    rwccu.setYRangeMin(0.0);
		    rwccu.plotZeroLine(false);
		    rwccu.plotRefPoint(false);
		    rwccu.setPolar(state.IsPolar);
		    rwccu.setPhiAngle((int)state.phi_angle);
		    rwccu.setType(7);
		    rwccu.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccv.setYRangeMax(state.HfieldCartyMax);
		    rwccv.setYRangeMin(0.0);
		    rwccv.plotZeroLine(false);
		    rwccv.plotRefPoint(false);
		    rwccv.setPolar(state.IsPolar);
		    rwccv.setPhiAngle((int)state.phi_angle);
		    rwccv.setType(8);
		    rwccv.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccw.setYRangeMax(state.HfieldCart2yMax);
		    rwccw.setYRangeMin(0.0);
		    rwccw.plotZeroLine(false);
		    rwccw.plotRefPoint(false);
		    rwccw.setPolar(state.IsPolar);
		    rwccw.setPhiAngle((int)state.phi_angle);
		    rwccw.setType(8);
		    rwccw.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccx.setYRangeMax(state.HfieldCartzMax);
		    rwccx.setYRangeMin(0.0);
		    rwccx.plotZeroLine(false);
		    rwccx.plotRefPoint(false);
		    rwccx.setPolar(state.IsPolar);
		    rwccx.setPhiAngle((int)state.phi_angle);
		    rwccx.setType(9);
		    rwccx.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccy.setYRangeMax(state.HfieldCart2zMax);
		    rwccy.setYRangeMin(0.0);
		    rwccy.plotZeroLine(false);
		    rwccy.plotRefPoint(false);
		    rwccy.setPolar(state.IsPolar);
		    rwccy.setPhiAngle((int)state.phi_angle);
		    rwccy.setType(9);
		    rwccy.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    //---------------------------------------------------------
		    
		    state.Is_theta = true;
		    state.Is_radius = false;
		    
		    rwccf.plot(state.x_polar,state.ethetaM);
		    rwcch.plot(state.x_polar,state.eradM);
		    rwcch2.plot(state.x_polar,state.ephigenM);
		    rwccg.plot(state.x_polar,state.ephiM);
		    rwccj.plot(state.x_polar,state.ephiradM);
		    rwccj2.plot(state.x_polar,state.ephiphiM);
		    rwccr.plot(state.x_polar,state.hphigenM);
		    rwccs.plot(state.x_polar,state.hphiM);
		    
		    rwcck.plot(state.x_polar,state.ex);
		    rwccl.plot(state.x_polar,state.ey);
		    rwccm.plot(state.x_polar,state.ez);
		    rwccn.plot(state.x_polar,state.ephix);
		    rwcco.plot(state.x_polar,state.ephiy);
		    rwccp.plot(state.x_polar,state.ephiz);
		    rwcct.plot(state.x_polar,state.hx);
		    rwccu.plot(state.x_polar,state.hphix);
		    rwccv.plot(state.x_polar,state.hy);
		    rwccw.plot(state.x_polar,state.hphiy);
		    rwccx.plot(state.x_polar,state.hz);
		    rwccy.plot(state.x_polar,state.hphiz);
		    
		    rwccf.ignition();
		    rwccf.repaint();
		    rwccg.ignition();
		    rwccg.repaint();
		    rwcch.ignition();
		    rwcch.repaint();
		    rwccj.ignition();
		    rwccj.repaint();
		    rwcch2.ignition();
		    rwcch2.repaint();
		    rwccj2.ignition();
		    rwccj2.repaint();
		    rwcck.ignition();
		    rwcck.repaint();
		    rwccl.ignition();
		    rwccl.repaint();
		    rwccm.ignition();
		    rwccm.repaint();
		    rwccn.ignition();
		    rwccn.repaint();
		    rwcco.ignition();
		    rwcco.repaint();
		    rwccp.ignition();
		    rwccp.repaint();
		    rwccr.ignition();
		    rwccr.repaint();
		    rwccs.ignition();
		    rwccs.repaint();
		    
		    rwccr2.ignition();
		    rwccr2.repaint();
		    rwccs2.ignition();
		    rwccs2.repaint();
		    
		    rwccr3.ignition();
		    rwccr3.repaint();
		    rwccs3.ignition();
		    rwccs3.repaint();
		    
		    rwcct.ignition();
		    rwcct.repaint();
		    rwccu.ignition();
		    rwccu.repaint();
		    rwccv.ignition();
		    rwccv.repaint();
		    rwccw.ignition();
		    rwccw.repaint();
		    rwccx.ignition();
		    rwccx.repaint();
		    rwccy.ignition();
		    rwccy.repaint();
		    
		    rwc.setField(state.IsEfield);
		    rwc.set3D(true);
		    rwc.repaint();
		    
		    rwc2.setFrequency(state.frequency);
		    rwc2.setEpsilon(state.epsilon_r);
		    rwc2.setWavelength(state.wavelength);
		    rwc2.setTheta(state.theta_angle);
		    rwc2.setPhi(state.phi_angle);
		    rwc2.setDistance(state.point_distance);
    
		    rwc2.repaint();
		    
		    outputpanel2.rwocC.repaint();
		    outputpanel2.rwocD.repaint();
		    outputpanel2.tcanvas.repaint();
		    outputpanel3.rwocE.repaint();
		    outputpanel3.rwocF.repaint();
		    outputpanel3.tcanvas2.repaint();
		    outputpanel4.rwocG.repaint();
		    outputpanel4.rwocH.repaint();
		    outputpanel4.tcanvas3.repaint();
		    outputpanel5.rwocI.repaint();
		    outputpanel5.rwocJ.repaint();
		    outputpanel5.tcanvas4.repaint();
		    
		    outputpanel4b.rwocGb.repaint();
		    outputpanel4b.rwocHb.repaint();
		    outputpanel4b.tcanvas3b.repaint();
		    outputpanel5b.rwocIb.repaint();
		    outputpanel5b.rwocJb.repaint();
		    outputpanel5b.tcanvas4b.repaint();
		    
		    outputpanel6.rwocK.repaint();
		    outputpanel6.rwocL.repaint();
		    outputpanel6.tcanvas5.repaint();
		    outputpanel7.rwocM.repaint();
		    outputpanel7.rwocN.repaint();
		    outputpanel7.tcanvas6.repaint();
		    outputpanel8.rwocO.repaint();
		    outputpanel8.rwocP.repaint();
		    outputpanel8.tcanvas7.repaint();
		    outputpanel9.rwocQ.repaint();
		    outputpanel9.rwocR.repaint();
		    outputpanel9.tcanvas8.repaint();
		    outputpanel10.rwocS.repaint();
		    outputpanel10.rwocT.repaint();
		    outputpanel10.tcanvas9.repaint();
		    outputpanel11.rwocU.repaint();
		    outputpanel11.rwocV.repaint();
		    outputpanel11.tcanvas10.repaint();
		    outputpanel13.rwoc6P.repaint();
		    outputpanel13.rwoc7P.repaint();
		    outputpanel13.tcanvas12.repaint();
		    outputpanel14.rwoc8P.repaint();
		    outputpanel14.rwoc9P.repaint();
		    outputpanel14.tcanvas13.repaint();
		    
		    outputpanel13b.rwoc6Pb.repaint();
		    outputpanel13b.rwoc7Pb.repaint();
		    outputpanel13b.tcanvas12b.repaint();
		    outputpanel14b.rwoc8Pb.repaint();
		    outputpanel14b.rwoc9Pb.repaint();
		    outputpanel14b.tcanvas13b.repaint();
		    
		    outputpanel13c.rwoc6Pc.repaint();
		    outputpanel13c.rwoc7Pc.repaint();
		    outputpanel13c.tcanvas12c.repaint();
		    outputpanel14c.rwoc8Pc.repaint();
		    outputpanel14c.rwoc9Pc.repaint();
		    outputpanel14c.tcanvas13c.repaint();
		    
		    outputpanel15.rwoc10P.repaint();
		    outputpanel15.rwoc11P.repaint();
		    outputpanel15.tcanvas14.repaint();
		    outputpanel16.rwoc12P.repaint();
		    outputpanel16.rwoc13P.repaint();
		    outputpanel16.tcanvas15.repaint();
		    outputpanel17.rwoc14P.repaint();
		    outputpanel17.rwoc15P.repaint();
		    outputpanel17.tcanvas16.repaint();
		    outputpanel18.rwoc16P.repaint();
		    outputpanel18.rwoc17P.repaint();
		    outputpanel18.tcanvas17.repaint();
		    outputpanel19.rwoc18P.repaint();
		    outputpanel19.rwoc19P.repaint();
		    outputpanel19.tcanvas18.repaint();
		    outputpanel20.rwoc20P.repaint();
		    outputpanel20.rwoc21P.repaint();
		    outputpanel20.tcanvas19.repaint();
		    
		    inputpanel2.text4.setText(""+state.point_distance);
		    inputpanel2.slider2.setValue((int)((state.point_distance-state.distance_minimum)*inputpanel2.ScrollMax/(state.distance_maximum-state.distance_minimum)));
		    inputpanel2.repaint();
	 }
	
	else if(evt.getSource()==inputpanel.b1){
	    
	    a_panel.setUnit(true);
	    
		a_panel.setMinimum(state.a_minimum);
		a_panel.setMaximum(state.a_maximum);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a_panel.setVisible(true);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    	    
	}
	
	else if(evt.getSource()==inputpanel.b3){
	    
	    a2_panel.setUnit(true);
	    
	    a2_panel.setMinimum(state.a2_minimum);
	    a2_panel.setMaximum(state.a2_maximum);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a2_panel.setVisible(true);
	    a_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    	    
	}

	else if(evt.getSource()==inputpanel.b2){
	    frequency_panel.setUnit(true);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(true);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	}
	
	else if(evt.getSource()==inputpanel3.b2){
	    current_panel.setUnit(true);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a_panel.setVisible(false);
	    inputpanel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(true);
	    current2_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	}
	
	else if(evt.getSource()==inputpanel3.b3){
	    current2_panel.setUnit(true);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a_panel.setVisible(false);
	    inputpanel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current2_panel.setVisible(true);
	    current_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcck.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	}
	
	
	else if(evt.getSource()==inputpanel2.b2){
	    distance_panel.setUnit(true);
	   
		distance_panel.setMinimum(state.distance_minimum);
		distance_panel.setMaximum(state.distance_maximum);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    inputpanel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    distance_panel.setVisible(true);
	    adist_panel.setVisible(false);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	}
	
	else if(evt.getSource()==inputpanel3.b1){
	    
	    adist_panel.setUnit(true);
	    
		adist_panel.setMinimum(state.antenna_distance_minimum);
		adist_panel.setMaximum(state.antenna_distance_maximum);
	    
	    inputpanel.setVisible(false);
	    inputpanel2.setVisible(false);
	    inputpanel3.setVisible(false);
	    a_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    adist_panel.setVisible(true);
	    
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    cp3D.setVisible(false);
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);   
	}

	else if(evt.getSource()==a_panel.b1){
	    
	    inputpanel.setVisible(true);
	    
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	  
		state.a_minimum = a_panel.getMinimum();
		state.a_maximum = a_panel.getMaximum();
	
		if(state.a >= state.a_minimum && state.a <= state.a_maximum){
		    inputpanel.slider1.setValue((int)(inputpanel.ScrollMax*(state.a-state.a_minimum)
						    /(state.a_maximum-state.a_minimum)));
		}
		else if(state.a < state.a_minimum){
		    state.a = state.a_minimum;
		    inputpanel.slider1.setValue(0);
		    inputpanel.text1.setText(""+state.a);
		}
	
		else if(state.a > state.a_maximum){
		    state.a = state.a_maximum;
		    inputpanel.slider1.setValue(inputpanel.ScrollMax);
		    inputpanel.text1.setText(""+state.a);
		}
	    
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
	    
	    rwcca.setYRangeMax(state.DVMax);
	    rwcca.setYRangeMin(0.0);
	    rwcca.plotZeroLine(false);
	    rwcca.plotRefPoint(true);
	    rwcca.setLabels("Directivity","","Dipole Length L","");
	    rwcca.setRefPoint(state.a);
	    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
	    rwcca.ignition();
	    rwcca.repaint();
	    
	    rwccb.setYRangeMax(state.RVMax);
	    rwccb.setYRangeMin(0.0);
	    rwccb.plotZeroLine(false);
	    rwccb.plotRefPoint(true);
	    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
	    rwccb.setRefPoint(state.a);
	    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
	    rwccb.ignition();
	    rwccb.repaint();
	    
	    rwccb2.setYRangeMax(state.XVMax);
	    rwccb2.setYRangeMin(state.XVMin);
	    rwccb2.plotZeroLine(true);
	    rwccb2.plotRefPoint(true);
	    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
	    rwccb2.setRefPoint(state.a);
	    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
	    rwccb2.ignition();
	    rwccb2.repaint();
	    
	    rwccd.setYRangeMax(state.RinVMax);
	    rwccd.setYRangeMin(0.0);
	    rwccd.plotZeroLine(false);
	    rwccd.plotRefPoint(true);
	    rwccd.setLabels("Input Resistance","","Dipole Length L","");
	    rwccd.setRefPoint(state.a);
	    rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
	    rwccd.ignition();
	    rwccd.repaint();
	    
	    rwccd2.setYRangeMax(state.XinVMax);
	    rwccd2.setYRangeMin(state.XinVMin);
	    rwccd2.plotZeroLine(true);
	    rwccd2.plotRefPoint(true);
	    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
	    rwccd2.setRefPoint(state.a);
	    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
	    rwccd2.ignition();
	    rwccd2.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	}
	
	else if(evt.getSource()==a2_panel.b1){
	    
	    inputpanel.setVisible(true);
	    
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	  
		state.a2_minimum = a2_panel.getMinimum();
		state.a2_maximum = a2_panel.getMaximum();
	
		if(state.a2 >= state.a2_minimum && state.a2 <= state.a2_maximum){
		    inputpanel.slider3.setValue((int)(inputpanel.ScrollMax*(state.a2-state.a2_minimum)
						    /(state.a2_maximum-state.a2_minimum)));
		}
		else if(state.a2 < state.a2_minimum){
		    state.a2 = state.a2_minimum;
		    inputpanel.slider3.setValue(0);
		    inputpanel.text2.setText(""+state.a2);
		}
	
		else if(state.a2 > state.a2_maximum){
		    state.a2 = state.a2_maximum;
		    inputpanel.slider3.setValue(inputpanel.ScrollMax);
		    inputpanel.text2.setText(""+state.a2);
		}
	    
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
	    
	    rwcca.setYRangeMax(state.DVMax);
	    rwcca.setYRangeMin(0.0);
	    rwcca.plotZeroLine(false);
	    rwcca.plotRefPoint(true);
	    rwcca.setLabels("Directivity","","Dipole Length L","");
	    rwcca.setRefPoint(state.a);
	    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
	    rwcca.ignition();
	    rwcca.repaint();
	    
	    rwccb.setYRangeMax(state.RVMax);
	    rwccb.setYRangeMin(0.0);
	    rwccb.plotZeroLine(false);
	    rwccb.plotRefPoint(true);
	    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
	    rwccb.setRefPoint(state.a);
	    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
	    rwccb.ignition();
	    rwccb.repaint();
	    
	    rwccb2.setYRangeMax(state.XVMax);
	    rwccb2.setYRangeMin(state.XVMin);
	    rwccb2.plotZeroLine(true);
	    rwccb2.plotRefPoint(true);
	    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
	    rwccb2.setRefPoint(state.a);
	    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
	    rwccb2.ignition();
	    rwccb2.repaint();
	    
	    rwccd.setYRangeMax(state.RinVMax);
	    rwccd.setYRangeMin(0.0);
	    rwccd.plotZeroLine(false);
	    rwccd.plotRefPoint(true);
	    rwccd.setLabels("Input Resistance","","Dipole Length L","");
	    rwccd.setRefPoint(state.a);
	    rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
	    rwccd.ignition();
	    rwccd.repaint();
	    
	    rwccd2.setYRangeMax(state.XinVMax);
	    rwccd2.setYRangeMin(state.XinVMin);
	    rwccd2.plotZeroLine(true);
	    rwccd2.plotRefPoint(true);
	    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
	    rwccd2.setRefPoint(state.a);
	    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
	    rwccd2.ignition();
	    rwccd2.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	}
	
	else if(evt.getSource()==frequency_panel.b1){
	    
	    inputpanel.setVisible(true);
	    
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	    
	    state.frequency_minimum = frequency_panel.getMinimum();
	    state.frequency_maximum = frequency_panel.getMaximum();
	    
	    
	    if(state.frequency >= state.frequency_minimum && state.frequency <= state.frequency_maximum){
		inputpanel.slider2.setValue((int)(inputpanel.ScrollMax*(state.frequency-state.frequency_minimum)
						    /(state.frequency_maximum-state.frequency_minimum)));
	    }
	    else if(state.frequency < state.frequency_minimum){
		state.frequency = state.frequency_minimum;
		inputpanel.slider2.setValue(0);
		inputpanel.text4.setText(""+state.frequency);
	    }
	
	    else if(state.frequency > state.frequency_maximum){
		state.frequency = state.frequency_maximum;
		inputpanel.slider2.setValue(inputpanel.ScrollMax);
		inputpanel.text4.setText(""+state.frequency);
	    }
	    state.ignition();
	    //state.scan_coefficients();
	    state.scanCurrent();
	    
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint(); 
	    rwc2.repaint();
	}
	
	else if(evt.getSource()==current_panel.b1){
	    
	    inputpanel3.setVisible(true);
	    
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	    state.currentin_minimum = current_panel.getMinimum();
	    state.currentin_maximum = current_panel.getMaximum();
	    
	    
	    if(state.currentin >= state.currentin_minimum && state.currentin <= state.currentin_maximum){
		inputpanel3.slider3.setValue((int)(inputpanel3.ScrollMax*(state.currentin-state.currentin_minimum)
						    /(state.currentin_maximum-state.currentin_minimum)));
	    }
	    else if(state.currentin < state.currentin_minimum){
		state.currentin = state.currentin_minimum;
		inputpanel3.slider3.setValue(0);
		inputpanel3.text3.setText(""+state.currentin);
	    }
	
	    else if(state.currentin > state.currentin_maximum){
		state.currentin = state.currentin_maximum;
		inputpanel3.slider3.setValue(inputpanel3.ScrollMax);
		inputpanel3.text3.setText(""+state.currentin);
	    }
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
	    
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint(); 
	    rwc2.repaint();
	}
	
	else if(evt.getSource()==current2_panel.b1){
	    
	    inputpanel3.setVisible(true);
	    
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    distance_panel.setVisible(false);
	    
	    state.currentin2_minimum = current2_panel.getMinimum();
	    state.currentin2_maximum = current2_panel.getMaximum();
	    
	    
	    if(state.currentin2 >= state.currentin2_minimum && state.currentin2 <= state.currentin2_maximum){
		inputpanel3.slider4.setValue((int)(inputpanel3.ScrollMax*(state.currentin2-state.currentin2_minimum)
						    /(state.currentin2_maximum-state.currentin2_minimum)));
	    }
	    else if(state.currentin2 < state.currentin2_minimum){
		state.currentin2 = state.currentin2_minimum;
		inputpanel3.slider4.setValue(0);
		inputpanel3.text4.setText(""+state.currentin2);
	    }
	
	    else if(state.currentin2 > state.currentin2_maximum){
		state.currentin2 = state.currentin2_maximum;
		inputpanel3.slider4.setValue(inputpanel3.ScrollMax);
		inputpanel3.text4.setText(""+state.currentin2);
	    }
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
	    
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint(); 
	    rwc2.repaint();
	}
	
	else if(evt.getSource()==distance_panel.b1){
	    
	    inputpanel2.setVisible(true);
	    
	    distance_panel.setVisible(false);
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    inputpanel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    
		state.distance_minimum = distance_panel.getMinimum();
		state.distance_maximum = distance_panel.getMaximum();
	
		if(state.point_distance >= state.distance_minimum && state.point_distance <= state.distance_maximum){
		    inputpanel2.slider2.setValue((int)(inputpanel2.ScrollMax*(state.point_distance-state.distance_minimum)
						    /(state.distance_maximum-state.distance_minimum)));
		}
		else if(state.point_distance < state.distance_minimum){
		    state.point_distance = state.distance_minimum;
		    inputpanel2.slider2.setValue(0);
		    inputpanel2.text4.setText(""+state.point_distance);
		}
	
		else if(state.point_distance > state.distance_maximum){
		    state.point_distance = state.distance_maximum;
		    inputpanel2.slider2.setValue(inputpanel.ScrollMax);
		    inputpanel2.text4.setText(""+state.point_distance);
		}
	    
        
	    state.ignition();
	    //state.scan_coefficients();
	    state.scanCurrent();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	}
	
	else if(evt.getSource()==adist_panel.b1){
	    
	    inputpanel3.setVisible(true);
	    
	    distance_panel.setVisible(false);
	    a_panel.setVisible(false);
	    a2_panel.setVisible(false);
	    inputpanel.setVisible(false);
	    frequency_panel.setVisible(false);
	    current_panel.setVisible(false);
	    current2_panel.setVisible(false);
	    adist_panel.setVisible(false);
	    	  
		state.antenna_distance_minimum = adist_panel.getMinimum();
		state.antenna_distance_maximum = adist_panel.getMaximum();
	
		if(state.antenna_distance_lambda >= state.antenna_distance_minimum && state.antenna_distance_lambda <= state.antenna_distance_maximum){
		    inputpanel3.slider1.setValue((int)(inputpanel3.ScrollMax*(state.antenna_distance_lambda-state.antenna_distance_minimum)
						    /(state.antenna_distance_maximum-state.antenna_distance_minimum)));
		}
		else if(state.antenna_distance_lambda < state.antenna_distance_minimum){
		    state.antenna_distance_lambda = state.antenna_distance_minimum;
		    inputpanel3.slider1.setValue(0);
		    inputpanel3.text1.setText(""+state.antenna_distance_lambda);
		}
	
		else if(state.antenna_distance_lambda > state.antenna_distance_maximum){
		    state.antenna_distance_lambda = state.antenna_distance_maximum;
		    inputpanel3.slider1.setValue(inputpanel3.ScrollMax);
		    inputpanel3.text1.setText(""+state.antenna_distance_lambda);
		}
	    
	    state.ignition();
	    state.scan_coefficients();
	    state.scanCurrent();
	    
	    rwcca.setYRangeMax(state.DVMax);
	    rwcca.setYRangeMin(0.0);
	    rwcca.plotZeroLine(false);
	    rwcca.plotRefPoint(true);
	    rwcca.setLabels("Directivity","","Dipole Length L","");
	    rwcca.setRefPoint(state.a);
	    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
	    rwcca.ignition();
	    rwcca.repaint();
	    
	    rwccb.setYRangeMax(state.RVMax);
	    rwccb.setYRangeMin(0.0);
	    rwccb.plotZeroLine(false);
	    rwccb.plotRefPoint(true);
	    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
	    rwccb.setRefPoint(state.a);
	    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
	    rwccb.ignition();
	    rwccb.repaint();
	    
	    rwccb2.setYRangeMax(state.XVMax);
	    rwccb2.setYRangeMin(state.XVMin);
	    rwccb2.plotZeroLine(true);
	    rwccb2.plotRefPoint(true);
	    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
	    rwccb2.setRefPoint(state.a);
	    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
	    rwccb2.ignition();
	    rwccb2.repaint();
	    
	    rwccd.setYRangeMax(state.RinVMax);
	    rwccd.setYRangeMin(0.0);
	    rwccd.plotZeroLine(false);
	    rwccd.plotRefPoint(true);
	    rwccd.setLabels("Input Resistance","","Dipole Length L","");
	    rwccd.setRefPoint(state.a);
	    rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
	    rwccd.ignition();
	    rwccd.repaint();
	    
	    rwccd2.setYRangeMax(state.XinVMax);
	    rwccd2.setYRangeMin(state.XinVMin);
	    rwccd2.plotZeroLine(true);
	    rwccd2.plotRefPoint(true);
	    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
	    rwccd2.setRefPoint(state.a);
	    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
	    rwccd2.ignition();
	    rwccd2.repaint();
	    
	    rwc.setFrequency(state.frequency);
	    rwc.setField(state.IsEfield);
	    rwc.repaint();
	    rwc2.repaint();
	   
	    outputpanel.rwocA.repaint();
	    outputpanel.rwocB.repaint();
	    outputpanel.rwocField.repaint();
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	}
	
    }
    
    public void itemStateChanged(ItemEvent evt){
	ItemSelectable ie = evt.getItemSelectable();
	    
	if(evt.getSource()==inputpanel.ch2 || evt.getSource()==inputpanel3.ch2){
			
		if(ie.getSelectedObjects()[0]==" Directivity"){
		    state.IsDirectivity = true;
		    state.IsRad = false;
		    state.IsRin = false;
		    state.IsXrad = false;
		    state.IsXin = false;
		    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    //inputpanel.setVisible(true);
		    inputpanel2.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
		    
                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		    rwcca.setYRangeMax(state.DVMax);
		    rwcca.setYRangeMin(0.0);
		    rwcca.plotZeroLine(false);
		    rwcca.plotRefPoint(true);
		    rwcca.setLabels("Directivity","","Dipole Length L","");
		    rwcca.setRefPoint(state.a);
		    rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
		    
		    rwcca.setVisible(true);
		    rwcca.ignition();
		    rwcca.repaint();
		    rwccb.setVisible(false);
		    rwccb2.setVisible(false);
		    rwccd.setVisible(false);
		    rwccd2.setVisible(false);
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    rwc2.setVisible(false);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
		
		if(ie.getSelectedObjects()[0]==" Radiation Resistance"){
		    
		    state.IsDirectivity = false;
		    state.IsRad = true;
		    state.IsRin = false;
		    state.IsXrad = false;
		    state.IsXin = false;
		    
		    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    //inputpanel.setVisible(true);
		    inputpanel2.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);

                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		    rwccb.setYRangeMax(state.RVMax);
		    rwccb.setYRangeMin(0.0);
		    rwccb.plotZeroLine(false);
		    rwccb.plotRefPoint(true);
		    rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
		    rwccb.setRefPoint(state.a);
		    rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
		    
		    rwccb.setVisible(true);
		    rwccb2.setVisible(false);
		    rwcca.setVisible(false);
		    rwccd.setVisible(false);
		    rwccd2.setVisible(false);
		    rwccb.ignition();
		    rwccb.repaint();
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    rwc2.setVisible(false);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
		if(ie.getSelectedObjects()[0]==" Self Reactance"){
		    
		    state.IsDirectivity = false;
		    state.IsRad = false;
		    state.IsRin = false;
		    state.IsXrad = true;
		    state.IsXin = false;
		    
		    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    //inputpanel.setVisible(true);
		    inputpanel2.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);

                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		    rwccb2.setYRangeMax(state.XVMax);
		    rwccb2.setYRangeMin(state.XVMin);
		    rwccb2.plotZeroLine(true);
		    rwccb2.plotRefPoint(true);
		    rwccb2.setLabels("Self Reactance","","Dipole Length L","");
		    rwccb2.setRefPoint(state.a);
		    rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
		    
		    rwccb2.setVisible(true);
		    rwcca.setVisible(false);
		    rwccb.setVisible(false);
		    rwccd.setVisible(false);
		    rwccd2.setVisible(false);
		    rwccb2.ignition();
		    rwccb2.repaint();
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    rwc2.setVisible(false);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
		
		if(ie.getSelectedObjects()[0]==" Input Resistance"){
		    
		    state.IsDirectivity = false;
		    state.IsRad = false;
		    state.IsRin = true;
		    state.IsXrad = false;
		    state.IsXin = false;
		    
		    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    //inputpanel.setVisible(true);
		    inputpanel2.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
		    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		    rwccd.setYRangeMax(state.RinVMax);
		    rwccd.setYRangeMin(0.0);
		    rwccd.plotZeroLine(false);
		    rwccd.plotRefPoint(true);
		    rwccd.setLabels("Input Resistance","","Dipole Length L","");
		    rwccd.setRefPoint(state.a);
		    rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
		    
		    rwccd.setVisible(true);
		    rwccd2.setVisible(false);
		    rwcca.setVisible(false);
		    rwccb.setVisible(false);
		    rwccb2.setVisible(false);
		    rwccd.ignition();
		    rwccd.repaint();
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    rwc2.setVisible(false);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
		
		if(ie.getSelectedObjects()[0]==" Input Reactance"){
		    
		    state.IsDirectivity = false;
		    state.IsRad = false;
		    state.IsRin = false;
		    state.IsXrad = false;
		    state.IsXin = true;
		    
		    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    //inputpanel.setVisible(true);
		    inputpanel2.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
		    
		    rwccd2.setYRangeMax(state.XinVMax);
		    rwccd2.setYRangeMin(state.XinVMin);
		    rwccd2.plotZeroLine(true);
		    rwccd2.plotRefPoint(true);
		    rwccd2.setLabels("Input Reactance","","Dipole Length L","");
		    rwccd2.setRefPoint(state.a);
		    rwccd2.plot(state.leng,state.XinVector, state.XVector, state.IsDirectivity);
		    
		    rwccd2.setVisible(true);
		    rwccd.setVisible(false);
		    rwcca.setVisible(false);
		    rwccb.setVisible(false);
		    rwccb2.setVisible(false);
		    rwccd2.ignition();
		    rwccd2.repaint();
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    rwc2.setVisible(false);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}		
	}
	//----------------------
	
	
	if(evt.getSource()==rwconp.ch2){
	
		if(ie.getSelectedObjects()[0]==" Set Antenna Parameters"){
		    // Reposition input panels - They were moved because of MAC flicker - MAC sucks!!!
                    
                    inputpanel.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel2.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel3.setBounds(12+xmove,262+ymove,296,296);
                    
                    state.ShowWhich = 1;
                    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    inputpanel.setVisible(true);
		    inputpanel2.setVisible(false);
		    inputpanel3.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            	    
		    if(state.IsDirectivity){
			//rwcca.setVisible(true);
			rwcca.setVisible(false);
			rwccb.setVisible(false);
			rwccb2.setVisible(false);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwcca.setYRangeMax(state.DVMax);
			rwcca.setYRangeMin(0.0);
			rwcca.plotZeroLine(false);
			rwcca.plotRefPoint(true);
			rwcca.setLabels("Directivity","","Dipole Length L","");
			rwcca.setRefPoint(state.a);
			rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
			rwcca.ignition();
			rwcca.repaint();
		    }
		    if(state.IsRad){
			//rwccb.setVisible(true);
			rwccb.setVisible(false);
			rwccb2.setVisible(false);
			rwcca.setVisible(false);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwccb.setYRangeMax(state.RVMax);
			rwccb.setYRangeMin(0.0);
			rwccb.plotZeroLine(false);
			rwccb.plotRefPoint(true);
			rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
			rwccb.setRefPoint(state.a);
			rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
			rwccb.ignition();
			rwccb.repaint();
		    }
		    if(state.IsXrad){
			rwccb.setVisible(false);
			//rwccb2.setVisible(true);
			rwccb2.setVisible(false);
			rwcca.setVisible(false);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwccb2.setYRangeMax(state.XVMax);
			rwccb2.setYRangeMin(state.XVMin);
			rwccb2.plotZeroLine(true);
			rwccb2.plotRefPoint(true);
			rwccb2.setLabels("Self Reactance","","Dipole Length L","");
			rwccb2.setRefPoint(state.a);
			rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
			rwccb2.ignition();
			rwccb2.repaint();
		    }
		    if(state.IsRin){
			//rwccd.setVisible(true);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwcca.setVisible(false);
			rwccb.setVisible(false);
			rwccb2.setVisible(false);
			rwccd.setYRangeMax(state.RinVMax);
			rwccd.setYRangeMin(0.0);
			rwccd.plotZeroLine(false);
			rwccd.plotRefPoint(true);
			rwccd.setLabels("Input Resistance","","Dipole Length L","");
			rwccd.setRefPoint(state.a);
			rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
			rwccd.ignition();
			rwccd.repaint();
		    }	    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    //rwc2.setVisible(false);
		    rwc2.setVisible(true);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
		
		
		if(ie.getSelectedObjects()[0]==" Set Array Parameters"){
		    // Reposition input panels - They were moved because of MAC flicker - MAC sucks!!!
                    
                    inputpanel.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel2.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel3.setBounds(12+xmove,262+ymove,296,296);
                    
                    state.ShowWhich =2;
                    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    inputpanel.setVisible(false);
		    inputpanel2.setVisible(false);
		    inputpanel3.setVisible(true);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    outputpanel.c1.select(" Antenna Data "); 
		    outputpanel.rwocA.setVisible(true);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(false); 
		    
		    outputpanel12.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            	    
		    if(state.IsDirectivity){
			//rwcca.setVisible(true);
			rwcca.setVisible(false);
			rwccb.setVisible(false);
			rwccb2.setVisible(false);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwcca.setYRangeMax(state.DVMax);
			rwcca.setYRangeMin(0.0);
			rwcca.plotZeroLine(false);
			rwcca.plotRefPoint(true);
			rwcca.setLabels("Directivity","","Dipole Length L","");
			rwcca.setRefPoint(state.a);
			rwcca.plot(state.leng,state.DVector, state.IsDirectivity);
			rwcca.ignition();
			rwcca.repaint();
		    }
		    if(state.IsRad){
			rwccb.setVisible(false);
			//rwccb.setVisible(true);
			rwccb2.setVisible(false);
			rwcca.setVisible(false);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwccb.setYRangeMax(state.RVMax);
			rwccb.setYRangeMin(0.0);
			rwccb.plotZeroLine(false);
			rwccb.plotRefPoint(true);
			rwccb.setLabels("Radiation Resistance","","Dipole Length L","");
			rwccb.setRefPoint(state.a);
			rwccb.plot(state.leng,state.RVector, state.IsDirectivity);
			rwccb.ignition();
			rwccb.repaint();
		    }
		    if(state.IsXrad){
			rwccb.setVisible(false);
			//rwccb2.setVisible(true);
			rwccb2.setVisible(false);
			rwcca.setVisible(false);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwccb2.setYRangeMax(state.XVMax);
			rwccb2.setYRangeMin(state.XVMin);
			rwccb2.plotZeroLine(true);
			rwccb2.plotRefPoint(true);
			rwccb2.setLabels("Self Reactance","","Dipole Length L","");
			rwccb2.setRefPoint(state.a);
			rwccb2.plot(state.leng,state.XVector, state.IsDirectivity);
			rwccb2.ignition();
			rwccb2.repaint();
		    }
		    if(state.IsRin){
			//rwccd.setVisible(true);
			rwccd.setVisible(false);
			rwccd2.setVisible(false);
			rwcca.setVisible(false);
			rwccb.setVisible(false);
			rwccb2.setVisible(false);
			rwccd.setYRangeMax(state.RinVMax);
			rwccd.setYRangeMin(0.0);
			rwccd.plotZeroLine(false);
			rwccd.plotRefPoint(true);
			rwccd.setLabels("Input Resistance","","Dipole Length L","");
			rwccd.setRefPoint(state.a);
			rwccd.plot(state.leng,state.RinVector, state.RVector, state.IsDirectivity);
			rwccd.ignition();
			rwccd.repaint();
		    }	    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    //rwc2.setVisible(false);
		    rwc2.setVisible(true);
		    cp3D.setVisible(false);
		    
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
		
		if(ie.getSelectedObjects()[0]==" Scan Fields and Power"){
		    // Reposition input panels - They were moved because of MAC flicker - MAC sucks!!!
                    
                    inputpanel.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel2.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel3.setBounds(12+xmove,262+ymove,296,296);
                    
                    state.ShowWhich = 3;
		    state.ignition();
		    //state.scan_coefficients();
		    state.scanCurrent();
		    
		    rwccq.setVisible(false);
		    inputpanel.setVisible(false);
		    inputpanel2.setVisible(true);
		    inputpanel3.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    
		    outputpanel.setVisible(true);
		    
		    outputpanel.c1.select(" Field Scanner "); 
		    outputpanel.rwocA.setVisible(false);
		    outputpanel.rwocB.setVisible(false);
		    outputpanel.rwocField.setVisible(true); 
		    
		    outputpanel12.setVisible(false); 
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
		    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    rwc2.setVisible(true);
		    cp3D.setVisible(false);
		    //rwc.set3D(false);
		    //rwc.setCurrent(true);
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
	
		if(ie.getSelectedObjects()[0]==" Plot Current Distribution"){
		    // Reposition input panels - They were moved because of MAC flicker - MAC sucks!!!
                    
                    inputpanel.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel2.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel3.setBounds(12+xmove,262+ymove,296,296);
                    
                    state.ShowWhich = 4;
                    state.ignition();
		    //state.scan_coefficients();
		    
		    state.scanCurrent();
		
		    curlab();
	    
		    rwccq.setVisible(true);
		    inputpanel.setVisible(false);
		    inputpanel2.setVisible(false);
		    inputpanel3.setVisible(false);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
		    		    
		    outputpanel.setVisible(false);
		    
                    outputpanel12.setVisible(true);
		    
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false);
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            	    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.setVisible(false);
		    rwccg.setVisible(false);
	    
		    cp3D.setVisible(false);
		    rwc2.setVisible(false);
		    
		    rwccq.ignition();
		    rwccq.repaint();
		    
		    rwc.set3D(false);
		    rwc.setField(state.IsEfield);
		    rwc.repaint(); 
		    rwc2.repaint(); 
		}
                
                if(ie.getSelectedObjects()[0]==" Instructions"){
		    //about.setVisible(true);
		    instructions.setVisible(true);
                    instrFrame.setVisible(true);
                }

		
		if(ie.getSelectedObjects()[0]==" Plot Field Distribution"){
		    state.ShowWhich = 5;
                    state.ignition();
                    
                    //  Move temporarily away to avoid flicker with MAC - MAC sucks!!!
                    
                    inputpanel.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel2.setBounds(12+xmove,262+ymove,296,296);
                    inputpanel3.setBounds(12+xmove,262+ymove,296,296);
                    
		    state.scan3Dfield();
		    
		    //hide current plot
		    rwccq.setVisible(false);
		    
		    rwccf.setYRangeMax(state.EfieldMax);
		    rwccf.setYRangeMin(0.0);
		    rwccf.plotZeroLine(false);
		    rwccf.plotRefPoint(false);
		    rwccf.setPolar(state.IsPolar);
		    rwccf.setPhiAngle((int)state.phi_angle);
		    rwccf.setType(1);
		    rwccf.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccg.setYRangeMax(state.EfieldphiMax);
		    rwccg.setYRangeMin(0.0);
		    rwccg.plotZeroLine(false);
		    rwccg.plotRefPoint(false);
		    rwccg.setPolar(state.IsPolar);
		    rwccg.setPhiAngle((int)state.phi_angle);
		    rwccg.setType(1);
		    rwccg.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcch.setYRangeMax(state.EfieldRadMax);
		    rwcch.setYRangeMin(0.0);
		    rwcch.plotZeroLine(false);
		    rwcch.plotRefPoint(false);
		    rwcch.setPolar(state.IsPolar);
		    rwcch.setPhiAngle((int)state.phi_angle);
		    rwcch.setType(2);
		    rwcch.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwcch2.setYRangeMax(state.EfieldPhigenMax);
		    rwcch2.setYRangeMin(0.0);
		    rwcch2.plotZeroLine(false);
		    rwcch2.plotRefPoint(false);
		    rwcch2.setPolar(state.IsPolar);
		    rwcch2.setPhiAngle((int)state.phi_angle);
		    rwcch2.setType(10);
		    rwcch2.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		   
		    rwccj.setYRangeMax(state.EfieldphiRadMax);
		    rwccj.setYRangeMin(0.0);
		    rwccj.plotZeroLine(false);
		    rwccj.plotRefPoint(false);
		    rwccj.setPolar(state.IsPolar);
		    rwccj.setPhiAngle((int)state.phi_angle);
		    rwccj.setType(2);
		    rwccj.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccj2.setYRangeMax(state.EfieldphiPhiMax);
		    rwccj2.setYRangeMin(0.0);
		    rwccj2.plotZeroLine(false);
		    rwccj2.plotRefPoint(false);
		    rwccj2.setPolar(state.IsPolar);
		    rwccj2.setPhiAngle((int)state.phi_angle);
		    rwccj2.setType(10);
		    rwccj2.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcck.setYRangeMax(state.EfieldCartxMax);
		    rwcck.setYRangeMin(0.0);
		    rwcck.plotZeroLine(false);
		    rwcck.plotRefPoint(false);
		    rwcck.setPolar(state.IsPolar);
		    rwcck.setPhiAngle((int)state.phi_angle);
		    rwcck.setType(3);
		    rwcck.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccl.setYRangeMax(state.EfieldCartyMax);
		    rwccl.setYRangeMin(0.0);
		    rwccl.plotZeroLine(false);
		    rwccl.plotRefPoint(false);
		    rwccl.setPolar(state.IsPolar);
		    rwccl.setPhiAngle((int)state.phi_angle);
		    rwccl.setType(4);
		    rwccl.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccm.setYRangeMax(state.EfieldCartzMax);
		    rwccm.setYRangeMin(0.0);
		    rwccm.plotZeroLine(false);
		    rwccm.plotRefPoint(false);
		    rwccm.setPolar(state.IsPolar);
		    rwccm.setPhiAngle((int)state.phi_angle);
		    rwccm.setType(5);
		    rwccm.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccn.setYRangeMax(state.EfieldCart2xMax);
		    rwccn.setYRangeMin(0.0);
		    rwccn.plotZeroLine(false);
		    rwccn.plotRefPoint(false);
		    rwccn.setPolar(state.IsPolar);
		    rwccn.setPhiAngle((int)state.phi_angle);
		    rwccn.setType(3);
		    rwccn.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcco.setYRangeMax(state.EfieldCart2yMax);
		    rwcco.setYRangeMin(0.0);
		    rwcco.plotZeroLine(false);
		    rwcco.plotRefPoint(false);
		    rwcco.setPolar(state.IsPolar);
		    rwcco.setPhiAngle((int)state.phi_angle);
		    rwcco.setType(4);
		    rwcco.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccp.setYRangeMax(state.EfieldCart2zMax);
		    rwccp.setYRangeMin(0.0);
		    rwccp.plotZeroLine(false);
		    rwccp.plotRefPoint(false);
		    rwccp.setPolar(state.IsPolar);
		    rwccp.setPhiAngle((int)state.phi_angle);
		    rwccp.setType(5);
		    rwccp.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccr.setYRangeMax(state.HfieldMax);
		    rwccr.setYRangeMin(0.0);
		    rwccr.plotZeroLine(false);
		    rwccr.plotRefPoint(false);
		    rwccr.setPolar(state.IsPolar);
		    rwccr.setPhiAngle((int)state.phi_angle);
		    rwccr.setType(6);
		    rwccr.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","A/m","\u03b8  [degrees]");
		    
		    rwccr2.setYRangeMax(state.HfieldRadMax);
		    rwccr2.setYRangeMin(0.0);
		    rwccr2.plotZeroLine(false);
		    rwccr2.plotRefPoint(false);
		    rwccr2.setPolar(state.IsPolar);
		    rwccr2.setPhiAngle((int)state.phi_angle);
		    rwccr2.setType(11);
		    rwccr2.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","A/m","\u03b8  [degrees]");
		    
		    rwccr3.setYRangeMax(state.HfieldThetaMax);
		    rwccr3.setYRangeMin(0.0);
		    rwccr3.plotZeroLine(false);
		    rwccr3.plotRefPoint(false);
		    rwccr3.setPolar(state.IsPolar);
		    rwccr3.setPhiAngle((int)state.phi_angle);
		    rwccr3.setType(12);
		    rwccr3.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","A/m","\u03b8  [degrees]");
		    
		    rwccs.setYRangeMax(state.HfieldphiMax);
		    rwccs.setYRangeMin(0.0);
		    rwccs.plotZeroLine(false);
		    rwccs.plotRefPoint(false);
		    rwccs.setPolar(state.IsPolar);
		    rwccs.setPhiAngle((int)state.phi_angle);
		    rwccs.setType(6);
		    rwccs.setLabels("\u03b8 = 90.0\u00ba plane","A/m","\u03c6  [degrees]");
		    
		    rwccs2.setYRangeMax(state.HfieldphiRadMax);
		    rwccs2.setYRangeMin(0.0);
		    rwccs2.plotZeroLine(false);
		    rwccs2.plotRefPoint(false);
		    rwccs2.setPolar(state.IsPolar);
		    rwccs2.setPhiAngle((int)state.phi_angle);
		    rwccs2.setType(11);
		    rwccs2.setLabels("\u03b8 = 90.0\u00ba plane","A/m","\u03c6  [degrees]");
		    
		    rwccs3.setYRangeMax(state.HfieldphiThetaMax);
		    rwccs3.setYRangeMin(0.0);
		    rwccs3.plotZeroLine(false);
		    rwccs3.plotRefPoint(false);
		    rwccs3.setPolar(state.IsPolar);
		    rwccs3.setPhiAngle((int)state.phi_angle);
		    rwccs3.setType(12);
		    rwccs3.setLabels("\u03b8 = 90.0\u00ba plane","A/m","\u03c6  [degrees]");
		    
		    rwcct.setYRangeMax(state.HfieldCartxMax);
		    rwcct.setYRangeMin(0.0);
		    rwcct.plotZeroLine(false);
		    rwcct.plotRefPoint(false);
		    rwcct.setPolar(state.IsPolar);
		    rwcct.setPhiAngle((int)state.phi_angle);
		    rwcct.setType(7);
		    rwcct.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","A/m","\u03b8  [degrees]");
		    
		    rwccu.setYRangeMax(state.HfieldCart2xMax);
		    rwccu.setYRangeMin(0.0);
		    rwccu.plotZeroLine(false);
		    rwccu.plotRefPoint(false);
		    rwccu.setPolar(state.IsPolar);
		    rwccu.setPhiAngle((int)state.phi_angle);
		    rwccu.setType(7);
		    rwccu.setLabels("\u03b8 = 90.0\u00ba plane","A/m","\u03c6  [degrees]");
		    
		    rwccv.setYRangeMax(state.HfieldCartyMax);
		    rwccv.setYRangeMin(0.0);
		    rwccv.plotZeroLine(false);
		    rwccv.plotRefPoint(false);
		    rwccv.setPolar(state.IsPolar);
		    rwccv.setPhiAngle((int)state.phi_angle);
		    rwccv.setType(8);
		    rwccv.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","A/m","\u03b8  [degrees]");
		    
		    rwccw.setYRangeMax(state.HfieldCart2yMax);
		    rwccw.setYRangeMin(0.0);
		    rwccw.plotZeroLine(false);
		    rwccw.plotRefPoint(false);
		    rwccw.setPolar(state.IsPolar);
		    rwccw.setPhiAngle((int)state.phi_angle);
		    rwccw.setType(8);
		    rwccw.setLabels("\u03b8 = 90.0\u00ba plane","A/m","\u03c6  [degrees]");
		    
		    rwccx.setYRangeMax(state.HfieldCartzMax);
		    rwccx.setYRangeMin(0.0);
		    rwccx.plotZeroLine(false);
		    rwccx.plotRefPoint(false);
		    rwccx.setPolar(state.IsPolar);
		    rwccx.setPhiAngle((int)state.phi_angle);
		    rwccx.setType(9);
		    rwccx.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","A/m","\u03b8  [degrees]");
		    
		    rwccy.setYRangeMax(state.HfieldCart2zMax);
		    rwccy.setYRangeMin(0.0);
		    rwccy.plotZeroLine(false);
		    rwccy.plotRefPoint(false);
		    rwccy.setPolar(state.IsPolar);
		    rwccy.setPhiAngle((int)state.phi_angle);
		    rwccy.setType(9);
		    rwccy.setLabels("\u03b8 = 90.0\u00ba plane","A/m","\u03c6  [degrees]");
		    
		    state.Is_theta = true;
		    state.Is_radius = false;
		    
		    rwc.set3D(true);
		    rwc.setField(state.IsEfield);
		    rwc.repaint();
		    rwc2.repaint();
		    
		    rwccf.plot(state.x_polar,state.ethetaM);
		    rwcch.plot(state.x_polar,state.eradM);
		    rwcch2.plot(state.x_polar,state.ephigenM);
		    rwccg.plot(state.x_polar,state.ephiM);
		    rwccj.plot(state.x_polar,state.ephiradM);
		    rwccj2.plot(state.x_polar,state.ephiphiM);
		    rwccr.plot(state.x_polar,state.hphigenM);
		    rwccs.plot(state.x_polar,state.hphiM);
		    rwccr2.plot(state.x_polar,state.hradM);
		    rwccs2.plot(state.x_polar,state.hphiradM);
		    rwccr3.plot(state.x_polar,state.hthetaM);
		    rwccs3.plot(state.x_polar,state.hphithetaM);
		    
		    rwcck.plot(state.x_polar,state.ex);
		    rwccl.plot(state.x_polar,state.ey);
		    rwccm.plot(state.x_polar,state.ez);
		    rwccn.plot(state.x_polar,state.ephix);
		    rwcco.plot(state.x_polar,state.ephiy);
		    rwccp.plot(state.x_polar,state.ephiz);
		    rwcct.plot(state.x_polar,state.hx);
		    rwccu.plot(state.x_polar,state.hphix);
		    rwccv.plot(state.x_polar,state.hy);
		    rwccw.plot(state.x_polar,state.hphiy);
		    rwccx.plot(state.x_polar,state.hz);
		    rwccy.plot(state.x_polar,state.hphiz);
		    
		    cp3D.setVisible(true);
		    rwc2.setVisible(false);
		    cp3D.ch1.setState(true);
		    cp3D.ch2.setState(false);
		    cp3D.ch3.setState(false);
		    cp3D.ch4.setState(false);
		    cp3D.ch5.setState(false);
		    cp3D.ch6.setState(false);
		    cp3D.cg1.setState(false);
		    cp3D.cg2.setState(false);
		    cp3D.cg3.setState(false);
		    cp3D.cg4.setState(false);
		    cp3D.cg5.setState(false);
		    cp3D.cg6.setState(false);
		    
		    cp3D.cplot1.setState(true);
		    cp3D.cplot2.setState(false);
		    cp3D.cplot3.setState(false);
		    
		    state.IsPolar = false;
		    rwccf.setPolar(state.IsPolar);
		    rwccg.setPolar(state.IsPolar);
		    rwcch.setPolar(state.IsPolar);
		    rwccj.setPolar(state.IsPolar);
		    rwcch2.setPolar(state.IsPolar);
		    rwccj2.setPolar(state.IsPolar);
		    rwcck.setPolar(state.IsPolar);
		    rwccl.setPolar(state.IsPolar);
		    rwccm.setPolar(state.IsPolar);
		    rwccn.setPolar(state.IsPolar);
		    rwcco.setPolar(state.IsPolar);
		    rwccp.setPolar(state.IsPolar);
		    rwccr.setPolar(state.IsPolar);
		    rwccs.setPolar(state.IsPolar);
		    rwccr2.setPolar(state.IsPolar);
		    rwccs2.setPolar(state.IsPolar);
		    rwccr3.setPolar(state.IsPolar);
		    rwccs3.setPolar(state.IsPolar);
		    
		    rwcct.setPolar(state.IsPolar);
		    rwccu.setPolar(state.IsPolar);
		    rwccv.setPolar(state.IsPolar);
		    rwccw.setPolar(state.IsPolar);
		    rwccx.setPolar(state.IsPolar);
		    rwccy.setPolar(state.IsPolar);
		    
		    a_panel.setVisible(false);
		    a2_panel.setVisible(false);
		    frequency_panel.setVisible(false);
		    current_panel.setVisible(false);
		    current2_panel.setVisible(false);
		    distance_panel.setVisible(false);
	    
		    inputpanel.setVisible(false);
		    inputpanel2.setVisible(false);
		    inputpanel3.setVisible(false);
		    outputpanel.setVisible(false);
		    outputpanel2.setVisible(false);
		    outputpanel3.setVisible(false);
		    outputpanel4.setVisible(false);
		    outputpanel5.setVisible(false);
		    outputpanel4b.setVisible(false);
		    outputpanel5b.setVisible(false);
		    outputpanel6.setVisible(false);
		    outputpanel7.setVisible(false);
		    outputpanel8.setVisible(false);
		    outputpanel9.setVisible(false);
		    outputpanel10.setVisible(false);
		    outputpanel11.setVisible(false);
		    outputpanel12.setVisible(false);
		    outputpanel13.setVisible(false);
		    outputpanel14.setVisible(false);
		    outputpanel13b.setVisible(false);
		    outputpanel14b.setVisible(false);
		    outputpanel13c.setVisible(false);
		    outputpanel14c.setVisible(false);
		    
		    outputpanel15.setVisible(false);
		    outputpanel16.setVisible(false);
		    outputpanel17.setVisible(false);
		    outputpanel18.setVisible(false); 
		    outputpanel19.setVisible(false);
		    outputpanel20.setVisible(false);
                    
                    outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                    outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                    outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                    outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            	    
		    rwccf.setVisible(true);
		    rwccg.setVisible(true);
		    rwcch.setVisible(false);
		    rwccj.setVisible(false);
		    rwcch2.setVisible(false);
		    rwccj2.setVisible(false);
		    rwcck.setVisible(false);
		    rwccl.setVisible(false);
		    rwccm.setVisible(false);
		    rwccn.setVisible(false);
		    rwcco.setVisible(false);
		    rwccp.setVisible(false);
		    rwccr.setVisible(false);
		    rwccs.setVisible(false);
		    rwccr2.setVisible(false);
		    rwccs2.setVisible(false);
		    rwccr3.setVisible(false);
		    rwccs3.setVisible(false);
		    
		    rwcct.setVisible(false);
		    rwccu.setVisible(false);
		    rwccv.setVisible(false);
		    rwccw.setVisible(false);
		    rwccx.setVisible(false);
		    rwccy.setVisible(false);
		    
		    rwccf.ignition();
		    rwccf.repaint();
		    rwccg.ignition();
		    rwccg.repaint();
		    rwcch.ignition();
		    rwcch.repaint();
		    rwccj.ignition();
		    rwccj.repaint();
		    rwcch2.ignition();
		    rwcch2.repaint();
		    rwccj2.ignition();
		    rwccj2.repaint();
		    rwcck.ignition();
		    rwcck.repaint();
		    rwccl.ignition();
		    rwccl.repaint();
		    rwccm.ignition();
		    rwccm.repaint();
		    rwccn.ignition();
		    rwccn.repaint();
		    rwcco.ignition();
		    rwcco.repaint();
		    rwccp.ignition();
		    rwccp.repaint();
		    rwccr.ignition();
		    rwccr.repaint();
		    rwccs.ignition();
		    rwccs.repaint();
		    
		    rwccr2.ignition();
		    rwccr2.repaint();
		    rwccs2.ignition();
		    rwccs2.repaint();
		    rwccr3.ignition();
		    rwccr3.repaint();
		    rwccs3.ignition();
		    rwccs3.repaint();
		    
		    rwcct.ignition();
		    rwcct.repaint();
		    rwccu.ignition();
		    rwccu.repaint();
		    rwccv.ignition();
		    rwccv.repaint();
		    rwccw.ignition();
		    rwccw.repaint();
		    rwccx.ignition();
		    rwccx.repaint();
		    rwccy.ignition();
		    rwccy.repaint();
		    
		    outputpanel2.rwocC.repaint();
		    outputpanel2.rwocD.repaint();
		    outputpanel2.tcanvas.repaint();
		    outputpanel3.rwocE.repaint();
		    outputpanel3.rwocF.repaint();
		    outputpanel3.tcanvas2.repaint();
		    outputpanel4.rwocG.repaint();
		    outputpanel4.rwocH.repaint();
		    outputpanel4.tcanvas3.repaint();
		    outputpanel5.rwocI.repaint();
		    outputpanel5.rwocJ.repaint();
		    outputpanel5.tcanvas4.repaint();
		    
		    outputpanel4b.rwocGb.repaint();
		    outputpanel4b.rwocHb.repaint();
		    outputpanel4b.tcanvas3b.repaint();
		    outputpanel5b.rwocIb.repaint();
		    outputpanel5b.rwocJb.repaint();
		    outputpanel5b.tcanvas4b.repaint();
		    
		    outputpanel6.rwocK.repaint();
		    outputpanel6.rwocL.repaint();
		    outputpanel6.tcanvas5.repaint();
		    outputpanel7.rwocM.repaint();
		    outputpanel7.rwocN.repaint();
		    outputpanel7.tcanvas6.repaint();
		    outputpanel8.rwocO.repaint();
		    outputpanel8.rwocP.repaint();
		    outputpanel8.tcanvas7.repaint();
		    outputpanel9.rwocQ.repaint();
		    outputpanel9.rwocR.repaint();
		    outputpanel9.tcanvas8.repaint();
		    outputpanel10.rwocS.repaint();
		    outputpanel10.rwocT.repaint();
		    outputpanel10.tcanvas9.repaint();
		    outputpanel11.rwocU.repaint();
		    outputpanel11.rwocV.repaint();
		    outputpanel11.tcanvas10.repaint();
		    outputpanel13.rwoc6P.repaint();
		    outputpanel13.rwoc7P.repaint();
		    outputpanel13.tcanvas12.repaint();
		    outputpanel14.rwoc8P.repaint();
		    outputpanel14.rwoc9P.repaint();
		    outputpanel14.tcanvas13.repaint();
		    
		    outputpanel13b.rwoc6Pb.repaint();
		    outputpanel13b.rwoc7Pb.repaint();
		    outputpanel13b.tcanvas12b.repaint();
		    outputpanel14b.rwoc8Pb.repaint();
		    outputpanel14b.rwoc9Pb.repaint();
		    outputpanel14b.tcanvas13b.repaint();
		    
		    outputpanel13c.rwoc6Pc.repaint();
		    outputpanel13c.rwoc7Pc.repaint();
		    outputpanel13c.tcanvas12c.repaint();
		    outputpanel14c.rwoc8Pc.repaint();
		    outputpanel14c.rwoc9Pc.repaint();
		    outputpanel14c.tcanvas13c.repaint();
		    
		    outputpanel15.rwoc10P.repaint();
		    outputpanel15.rwoc11P.repaint();
		    outputpanel15.tcanvas14.repaint();
		    outputpanel16.rwoc12P.repaint();
		    outputpanel16.rwoc13P.repaint();
		    outputpanel16.tcanvas15.repaint();
		    outputpanel17.rwoc14P.repaint();
		    outputpanel17.rwoc15P.repaint();
		    outputpanel17.tcanvas16.repaint();
		    outputpanel18.rwoc16P.repaint();
		    outputpanel18.rwoc17P.repaint();
		    outputpanel18.tcanvas17.repaint();
		    outputpanel19.rwoc18P.repaint();
		    outputpanel19.rwoc19P.repaint();
		    outputpanel19.tcanvas18.repaint();
		    outputpanel20.rwoc20P.repaint();
		    outputpanel20.rwoc21P.repaint();
		    outputpanel20.tcanvas19.repaint();
		}
                update3D();
	}
	
	if(evt.getSource()==outputpanel12.ch1){
	    state.IsA = true;
	    state.IsB = false;
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
		    rwccq.setYRangeMax(state.currentMAX);
		    rwccq.setYRangeMin(-state.currentMAX);
		    //rwccq.setYRangeMin(0.0);
		    rwccq.plotZeroLine(true);
		    rwccq.plotRefPoint(false);
		    
		    if(state.currentMAX >= 1.0){
			rwccq.setLabels("Current Distribution - Dipole A"," [ A ]","z");
			state.currentNormalization = 1.0;
		    }
		    else if(state.currentMAX >= 1.0e-3 && state.currentMAX < 1.0){
			rwccq.setLabels("Current Distribution - Dipole A"," [ mA ]","z");
			state.currentNormalization = 1.0e3;
		    }
		    else if(state.currentMAX >= 1.0e-6 && state.currentMAX < 1.0e-3){
			rwccq.setLabels("Current Distribution - Dipole A"," [ \u00b5A ]","z");
			state.currentNormalization = 1.0e6;
		    }
		    else if(state.currentMAX >= 1.0e-9 && state.currentMAX < 1.0e-6){
			rwccq.setLabels("Current Distribution - Dipole A"," [ nA ]","z");
			state.currentNormalization = 1.0e9;
		    }
		    else if(state.currentMAX >= 1.0e-12 && state.currentMAX < 1.0e-9){
			rwccq.setLabels("Current Distribution - Dipole A"," [ pA ]","z");
			state.currentNormalization = 1.0e12;
		    }
		    else if(state.currentMAX < 1.0e-12){
			rwccq.setLabels("Current Distribution - Dipole A"," [ fA ]","z");
			state.currentNormalization = 1.0e15;
		    }
		    rwccq.plot(state.zposLarge,state.currentMLarge,state.currentNormalization,state.currentMIN,state.currentin);
	    
	    rwccq.repaint();
            update3D();
	}
	
	if(evt.getSource()==outputpanel12.ch2){
	    state.IsB = true;
	    state.IsA = false;
	    outputpanel12.rwocW.repaint();
	    outputpanel12.rwocZ.repaint();
	    
		    rwccq.setYRangeMax(state.currentMAX2);
		    rwccq.setYRangeMin(-state.currentMAX2);
		    //rwccq.setYRangeMin(0.0);
		    rwccq.plotZeroLine(true);
		    rwccq.plotRefPoint(false);
		    
		    if(state.currentMAX2 >= 1.0){
			rwccq.setLabels("Current Distribution - Dipole B"," [ A ]","z");
			state.currentNormalization = 1.0;
		    }
		    else if(state.currentMAX2 >= 1.0e-3 && state.currentMAX2 < 1.0){
			rwccq.setLabels("Current Distribution - Dipole B"," [ mA ]","z");
			state.currentNormalization = 1.0e3;
		    }
		    else if(state.currentMAX2 >= 1.0e-6 && state.currentMAX2 < 1.0e-3){
			rwccq.setLabels("Current Distribution - Dipole B"," [ \u00b5A ]","z");
			state.currentNormalization = 1.0e6;
		    }
		    else if(state.currentMAX2 >= 1.0e-9 && state.currentMAX2 < 1.0e-6){
			rwccq.setLabels("Current Distribution - Dipole B"," [ nA ]","z");
			state.currentNormalization = 1.0e9;
		    }
		    else if(state.currentMAX2 >= 1.0e-12 && state.currentMAX2 < 1.0e-9){
			rwccq.setLabels("Current Distribution - Dipole B"," [ pA ]","z");
			state.currentNormalization = 1.0e12;
		    }
		    else if(state.currentMAX2 < 1.0e-12){
			rwccq.setLabels("Current Distribution - Dipole B"," [ fA ]","z");
			state.currentNormalization = 1.0e15;
		    }
		    rwccq.plot(state.zposLarge,state.currentMLarge2,state.currentNormalization,state.currentMIN2,state.currentin2);
		
	    
	    rwccq.repaint();
            update3D();
	}
	
	//------------------------
	if(evt.getSource()==cp3D.ch1){
	    
	    rwc.setField(true);
	    rwc.repaint();
	    
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwccf.setVisible(true);
	    rwccg.setVisible(true);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwccf.repaint();
	    rwccg.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(true);
		outputpanel3.setVisible(true);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);	
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
    	}
	if(evt.getSource()==cp3D.ch2){
	    rwc.setField(true);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(true);
	    rwccj.setVisible(true);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwcch.repaint();
	    rwccj.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(true);
		outputpanel5.setVisible(true);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.ch3){
	    rwc.setField(true);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch2.setVisible(true);
	    rwccj2.setVisible(true);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwcch2.repaint();
	    rwccj2.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(true);
		outputpanel5b.setVisible(true);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	
	if(evt.getSource()==cp3D.ch4){
	    rwc.setField(false);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(true);
	    rwccs.setVisible(true);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwccr.repaint();
	    rwccs.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(true);
		outputpanel14.setVisible(true);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);  
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.ch5){
	    rwc.setField(false);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(true);
	    rwccs2.setVisible(true);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwccr.repaint();
	    rwccs.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(true);
		outputpanel14b.setVisible(true);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);  
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.ch6){
	    rwc.setField(false);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(true);
	    rwccs3.setVisible(true);
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwccr.repaint();
	    rwccs.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(true);
		outputpanel14c.setVisible(true);
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);  
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cg1){
	    rwc.setField(true);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(true);
	    rwccl.setVisible(false);
	    rwccm.setVisible(false);
	    rwccn.setVisible(true);
	    rwcco.setVisible(false);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwcck.repaint();
	    rwccn.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(true);
		outputpanel7.setVisible(true);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cg2){
	    rwc.setField(true);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(true);
	    rwccm.setVisible(false);
	    rwccn.setVisible(false);
	    rwcco.setVisible(true);
	    rwccp.setVisible(false);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwccl.repaint();
	    rwcco.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(true);
		outputpanel9.setVisible(true);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cg3){
	    rwc.setField(true);
	    rwc.repaint();
	    
	    rwccf.setVisible(false);
	    rwccg.setVisible(false);
	    rwcch.setVisible(false);
	    rwccj.setVisible(false);
	    rwcch2.setVisible(false);
	    rwccj2.setVisible(false);
	    rwcck.setVisible(false);
	    rwccl.setVisible(false);
	    rwccm.setVisible(true);
	    rwccn.setVisible(false);
	    rwcco.setVisible(false);
	    rwccp.setVisible(true);
	    rwccr.setVisible(false);
	    rwccs.setVisible(false);
	    rwccr2.setVisible(false);
	    rwccs2.setVisible(false);
	    rwccr3.setVisible(false);
	    rwccs3.setVisible(false);
	    
	    rwcct.setVisible(false);
	    rwccu.setVisible(false);
	    rwccv.setVisible(false);
	    rwccw.setVisible(false);
	    rwccx.setVisible(false);
	    rwccy.setVisible(false);
	    
	    rwccm.repaint();
	    rwccp.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(true);
		outputpanel11.setVisible(true);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cg4){
		rwc.setField(false);
		rwc.repaint();
	    
		rwccf.setVisible(false);
		rwccg.setVisible(false);
		rwcch.setVisible(false);
		rwccj.setVisible(false);
		rwcch2.setVisible(false);
		rwccj2.setVisible(false);
		rwcck.setVisible(false);
		rwccl.setVisible(false);
		rwccm.setVisible(false);
		rwccn.setVisible(false);
		rwcco.setVisible(false);
		rwccp.setVisible(false);
		rwccr.setVisible(false);
		rwccs.setVisible(false);
		rwccr2.setVisible(false);
		rwccs2.setVisible(false);
		rwccr3.setVisible(false);
		rwccs3.setVisible(false);
		
		rwcct.setVisible(true);
		rwccu.setVisible(true);
		rwccv.setVisible(false);
		rwccw.setVisible(false);
		rwccx.setVisible(false);
		rwccy.setVisible(false);
	    
		rwcct.repaint();
		rwccu.repaint();
	    
	    if(cp3D.cplot3.getState()){
		
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(true);
		outputpanel16.setVisible(true);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cg5){
		rwc.setField(false);
		rwc.repaint();
	    
		rwccf.setVisible(false);
		rwccg.setVisible(false);
		rwcch.setVisible(false);
		rwccj.setVisible(false);
		rwcch2.setVisible(false);
		rwccj2.setVisible(false);
		rwcck.setVisible(false);
		rwccl.setVisible(false);
		rwccm.setVisible(false);
		rwccn.setVisible(false);
		rwcco.setVisible(false);
		rwccp.setVisible(false);
		rwccr.setVisible(false);
		rwccs.setVisible(false);
		rwccr2.setVisible(false);
		rwccs2.setVisible(false);
		rwccr3.setVisible(false);
		rwccs3.setVisible(false);
		
		rwcct.setVisible(false);
		rwccu.setVisible(false);
		rwccv.setVisible(true);
		rwccw.setVisible(true);
		rwccx.setVisible(false);
		rwccy.setVisible(false);
	    
		rwccv.repaint();
		rwccw.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(true);
		outputpanel18.setVisible(true);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cg6){
		rwc.setField(false);
		rwc.repaint();
	    
		rwccf.setVisible(false);
		rwccg.setVisible(false);
		rwcch.setVisible(false);
		rwccj.setVisible(false);
		rwcch2.setVisible(false);
		rwccj2.setVisible(false);
		rwcck.setVisible(false);
		rwccl.setVisible(false);
		rwccm.setVisible(false);
		rwccn.setVisible(false);
		rwcco.setVisible(false);
		rwccp.setVisible(false);
		rwccr.setVisible(false);
		rwccs.setVisible(false);
		rwccr2.setVisible(false);
		rwccs2.setVisible(false);
		rwccr3.setVisible(false);
		rwccs3.setVisible(false);
		
		rwcct.setVisible(false);
		rwccu.setVisible(false);
		rwccv.setVisible(false);
		rwccw.setVisible(false);
		rwccx.setVisible(true);
		rwccy.setVisible(true);
	    
		rwccv.repaint();
		rwccw.repaint();
	    
	    if(cp3D.cplot3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(true);
		outputpanel20.setVisible(true);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove,262+ymove,296,296);
	    }
            update3D();
	}
	
	if(evt.getSource()==cp3D.cplot1){
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    state.IsPolar = false;
	    rwccf.setPolar(state.IsPolar);
	    rwccg.setPolar(state.IsPolar);
	    rwcch.setPolar(state.IsPolar);
	    rwccj2.setPolar(state.IsPolar);
	    rwcch2.setPolar(state.IsPolar);
	    rwccj.setPolar(state.IsPolar);
	    rwcck.setPolar(state.IsPolar);
	    rwccl.setPolar(state.IsPolar);
	    rwccm.setPolar(state.IsPolar);
	    rwccn.setPolar(state.IsPolar);
	    rwcco.setPolar(state.IsPolar);
	    rwccp.setPolar(state.IsPolar);
	    rwccr.setPolar(state.IsPolar);
	    rwccs.setPolar(state.IsPolar);
	    rwccr2.setPolar(state.IsPolar);
	    rwccs2.setPolar(state.IsPolar);
	    rwccr3.setPolar(state.IsPolar);
	    rwccs3.setPolar(state.IsPolar);
	    
	    rwcct.setPolar(state.IsPolar);
	    rwccu.setPolar(state.IsPolar);
	    rwccv.setPolar(state.IsPolar);
	    rwccw.setPolar(state.IsPolar);
	    rwccx.setPolar(state.IsPolar);
	    rwccy.setPolar(state.IsPolar);
	    
	    rwccf.repaint();
	    rwccg.repaint();
	    rwcch.repaint();
	    rwccj.repaint();
	    rwcch2.repaint();
	    rwccj2.repaint();
	    rwcck.repaint();
	    rwccl.repaint();
	    rwccm.repaint();
	    rwccn.repaint();
	    rwcco.repaint();
	    rwccp.repaint();
	    rwccr.repaint();
	    rwccs.repaint();
	    rwccr2.repaint();
	    rwccs2.repaint();
	    rwccr3.repaint();
	    rwccs3.repaint();
	    
	    rwcct.repaint();
	    rwccu.repaint();
	    rwccv.repaint();
	    rwccw.repaint();
	    rwccx.repaint();
	    rwccy.repaint();
            
            update3D();
	}
	if(evt.getSource()==cp3D.cplot2){
	    outputpanel2.setVisible(false);
	    outputpanel3.setVisible(false);
	    outputpanel4.setVisible(false);
	    outputpanel5.setVisible(false);
	    outputpanel4b.setVisible(false);
	    outputpanel5b.setVisible(false);
	    outputpanel6.setVisible(false);
	    outputpanel7.setVisible(false);
	    outputpanel8.setVisible(false);
	    outputpanel9.setVisible(false);
	    outputpanel10.setVisible(false);
	    outputpanel11.setVisible(false);
	    outputpanel13.setVisible(false);
	    outputpanel14.setVisible(false);
	    outputpanel13b.setVisible(false);
	    outputpanel14b.setVisible(false);
	    outputpanel13c.setVisible(false);
	    outputpanel14c.setVisible(false);
	    
	    outputpanel15.setVisible(false);
	    outputpanel16.setVisible(false);
	    outputpanel17.setVisible(false);
	    outputpanel18.setVisible(false);
	    outputpanel19.setVisible(false);
	    outputpanel20.setVisible(false);
            
            outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
            outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
            outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
            outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    state.IsPolar = true;
	    rwccf.setPolar(state.IsPolar);
	    rwccg.setPolar(state.IsPolar);
	    rwcch.setPolar(state.IsPolar);
	    rwccj.setPolar(state.IsPolar);
	    rwcch2.setPolar(state.IsPolar);
	    rwccj2.setPolar(state.IsPolar);
	    rwcck.setPolar(state.IsPolar);
	    rwccl.setPolar(state.IsPolar);
	    rwccm.setPolar(state.IsPolar);
	    rwccn.setPolar(state.IsPolar);
	    rwcco.setPolar(state.IsPolar);
	    rwccp.setPolar(state.IsPolar);
	    rwccr.setPolar(state.IsPolar);
	    rwccs.setPolar(state.IsPolar);
	    rwccr2.setPolar(state.IsPolar);
	    rwccs2.setPolar(state.IsPolar);
	    rwccr3.setPolar(state.IsPolar);
	    rwccs3.setPolar(state.IsPolar);
	    
	    rwcct.setPolar(state.IsPolar);
	    rwccu.setPolar(state.IsPolar);
	    rwccv.setPolar(state.IsPolar);
	    rwccw.setPolar(state.IsPolar);
	    rwccx.setPolar(state.IsPolar);
	    rwccy.setPolar(state.IsPolar);
	    
	    rwccf.repaint();
	    rwccg.repaint();
	    rwcch.repaint();
	    rwccj.repaint();
	    rwcch2.repaint();
	    rwccj2.repaint();
	    rwcck.repaint();
	    rwccl.repaint();
	    rwccm.repaint();
	    rwccn.repaint();
	    rwcco.repaint();
	    rwccp.repaint();
	    rwccr.repaint();
	    rwccs.repaint();
	    rwccr2.repaint();
	    rwccs2.repaint();
	    rwccr3.repaint();
	    rwccs3.repaint();
	    
	    rwcct.repaint();
	    rwccu.repaint();
	    rwccv.repaint();
	    rwccw.repaint();
	    rwccx.repaint();
	    rwccy.repaint();
	
            update3D();
	}
	if(evt.getSource()==cp3D.cplot3){
	    if(cp3D.ch1.getState()){
		outputpanel2.setVisible(true);
		outputpanel3.setVisible(true);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.ch2.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(true);
		outputpanel5.setVisible(true);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.ch3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4b.setVisible(true);
		outputpanel5b.setVisible(true);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.ch4.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(true);
		outputpanel14.setVisible(true);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.ch5.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(true);
		outputpanel14b.setVisible(true);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.ch6.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(true);
		outputpanel14c.setVisible(true);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.cg1.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(true);
		outputpanel7.setVisible(true);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.cg2.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(true);
		outputpanel9.setVisible(true);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.cg3.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(true);
		outputpanel11.setVisible(true);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
	    }
	    if(cp3D.cg4.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel4b.setVisible(false);
		outputpanel5b.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(true);
		outputpanel16.setVisible(true);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		
		    outputpanel15.rwoc10P.repaint();
		    outputpanel15.rwoc11P.repaint();
		    outputpanel15.tcanvas14.repaint();
		    outputpanel16.rwoc12P.repaint();
		    outputpanel16.rwoc13P.repaint();
		    outputpanel16.tcanvas15.repaint();
	    }
	    if(cp3D.cg5.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel17.setVisible(true);
		outputpanel18.setVisible(true);
		outputpanel19.setVisible(false);
		outputpanel20.setVisible(false);
                
                outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove+10000,262+ymove,296,296);
            
		    
		    outputpanel17.rwoc14P.repaint();
		    outputpanel17.rwoc15P.repaint();
		    outputpanel17.tcanvas16.repaint();
		    outputpanel18.rwoc16P.repaint();
		    outputpanel18.rwoc17P.repaint();
		    outputpanel18.tcanvas17.repaint();
	    }
	    if(cp3D.cg6.getState()){
		outputpanel2.setVisible(false);
		outputpanel3.setVisible(false);
		outputpanel4.setVisible(false);
		outputpanel5.setVisible(false);
		outputpanel6.setVisible(false);
		outputpanel7.setVisible(false);
		outputpanel8.setVisible(false);
		outputpanel9.setVisible(false);
		outputpanel10.setVisible(false);
		outputpanel11.setVisible(false);
		outputpanel13.setVisible(false);
		outputpanel14.setVisible(false);
		outputpanel13b.setVisible(false);
		outputpanel14b.setVisible(false);
		outputpanel13c.setVisible(false);
		outputpanel14c.setVisible(false);
		
		outputpanel15.setVisible(false);
		outputpanel16.setVisible(false);
		outputpanel19.setVisible(true);
		outputpanel20.setVisible(true);
		outputpanel17.setVisible(false);
		outputpanel18.setVisible(false);
		    
		outputpanel2.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel3.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel4b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel5b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel6.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel7.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel8.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel9.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel10.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel11.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel12.setBounds(317+xmove+10000,57+ymove,296,196);
                outputpanel13.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13b.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14b.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel13c.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel14c.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel15.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel16.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel17.setBounds(317+xmove+10000,262+ymove,296,296);
                outputpanel18.setBounds(12+xmove+10000,262+ymove,296,296);
                outputpanel19.setBounds(317+xmove,262+ymove,296,296);
                outputpanel20.setBounds(12+xmove,262+ymove,296,296);
                
                    outputpanel19.rwoc18P.repaint();
		    outputpanel19.rwoc19P.repaint();
		    outputpanel19.tcanvas18.repaint();
		    outputpanel20.rwoc20P.repaint();
		    outputpanel20.rwoc21P.repaint();
		    outputpanel20.tcanvas19.repaint();
	    }
	    
	    state.IsPolar = false;
	    rwccf.setPolar(state.IsPolar);
	    rwccg.setPolar(state.IsPolar);
	    rwcch.setPolar(state.IsPolar);
	    rwccj.setPolar(state.IsPolar);
	    rwcch2.setPolar(state.IsPolar);
	    rwccj2.setPolar(state.IsPolar);
	    rwcck.setPolar(state.IsPolar);
	    rwccl.setPolar(state.IsPolar);
	    rwccm.setPolar(state.IsPolar);
	    rwccn.setPolar(state.IsPolar);
	    rwcco.setPolar(state.IsPolar);
	    rwccp.setPolar(state.IsPolar);
	    rwccr.setPolar(state.IsPolar);
	    rwccs.setPolar(state.IsPolar);
	    rwccr2.setPolar(state.IsPolar);
	    rwccs2.setPolar(state.IsPolar);
	    rwccr3.setPolar(state.IsPolar);
	    rwccs3.setPolar(state.IsPolar);
	    
	    rwcct.setPolar(state.IsPolar);
	    rwccu.setPolar(state.IsPolar);
	    rwccv.setPolar(state.IsPolar);
	    rwccw.setPolar(state.IsPolar);
	    rwccx.setPolar(state.IsPolar);
	    rwccy.setPolar(state.IsPolar);
	    
	    rwccf.repaint();
	    rwccg.repaint();
	    rwcch.repaint();
	    rwccj.repaint();
	    rwcch2.repaint();
	    rwccj2.repaint();
	    rwcck.repaint();
	    rwccl.repaint();
	    rwccm.repaint();
	    rwccn.repaint();
	    rwcco.repaint();
	    rwccp.repaint();
	    rwccr.repaint();
	    rwccs.repaint();
	    rwccr2.repaint();
	    rwccs2.repaint();
	    rwccr3.repaint();
	    rwccs3.repaint();
	    
	    rwcct.repaint();
	    rwccu.repaint();
	    rwccv.repaint();
	    rwccw.repaint();
	    rwccx.repaint();
	    rwccy.repaint();
            
            update3D();
	}
    }
    public void curlab(){
	if(state.IsA){
		    rwccq.setYRangeMax(state.currentMAX);
		    rwccq.setYRangeMin(-state.currentMAX);
		    //rwccq.setYRangeMin(0.0);
		    rwccq.plotZeroLine(true);
		    rwccq.plotRefPoint(false);
		    
		    if(state.currentMAX >= 1.0){
			rwccq.setLabels("Current Distribution - Dipole A"," [ A ]","z");
			state.currentNormalization = 1.0;
		    }
		    else if(state.currentMAX >= 1.0e-3 && state.currentMAX < 1.0){
			rwccq.setLabels("Current Distribution - Dipole A"," [ mA ]","z");
			state.currentNormalization = 1.0e3;
		    }
		    else if(state.currentMAX >= 1.0e-6 && state.currentMAX < 1.0e-3){
			rwccq.setLabels("Current Distribution - Dipole A"," [ \u00b5A ]","z");
			state.currentNormalization = 1.0e6;
		    }
		    else if(state.currentMAX >= 1.0e-9 && state.currentMAX < 1.0e-6){
			rwccq.setLabels("Current Distribution - Dipole A"," [ nA ]","z");
			state.currentNormalization = 1.0e9;
		    }
		    else if(state.currentMAX >= 1.0e-12 && state.currentMAX < 1.0e-9){
			rwccq.setLabels("Current Distribution - Dipole A"," [ pA ]","z");
			state.currentNormalization = 1.0e12;
		    }
		    else if(state.currentMAX < 1.0e-12){
			rwccq.setLabels("Current Distribution - Dipole A"," [ fA ]","z");
			state.currentNormalization = 1.0e15;
		    }
		    rwccq.plot(state.zposLarge,state.currentMLarge,state.currentNormalization,state.currentMIN,state.currentin);
		}
		else if(state.IsB){
		    rwccq.setYRangeMax(state.currentMAX2);
		    rwccq.setYRangeMin(-state.currentMAX2);
		    //rwccq.setYRangeMin(0.0);
		    rwccq.plotZeroLine(true);
		    rwccq.plotRefPoint(false);
		    
		    if(state.currentMAX2 >= 1.0){
			rwccq.setLabels("Current Distribution - Dipole B"," [ A ]","z");
			state.currentNormalization = 1.0;
		    }
		    else if(state.currentMAX2 >= 1.0e-3 && state.currentMAX2 < 1.0){
			rwccq.setLabels("Current Distribution - Dipole B"," [ mA ]","z");
			state.currentNormalization = 1.0e3;
		    }
		    else if(state.currentMAX2 >= 1.0e-6 && state.currentMAX2 < 1.0e-3){
			rwccq.setLabels("Current Distribution - Dipole B"," [ \u00b5A ]","z");
			state.currentNormalization = 1.0e6;
		    }
		    else if(state.currentMAX2 >= 1.0e-9 && state.currentMAX2 < 1.0e-6){
			rwccq.setLabels("Current Distribution - Dipole B"," [ nA ]","z");
			state.currentNormalization = 1.0e9;
		    }
		    else if(state.currentMAX2 >= 1.0e-12 && state.currentMAX2 < 1.0e-9){
			rwccq.setLabels("Current Distribution - Dipole B"," [ pA ]","z");
			state.currentNormalization = 1.0e12;
		    }
		    else if(state.currentMAX2 < 1.0e-12){
			rwccq.setLabels("Current Distribution - Dipole B"," [ fA ]","z");
			state.currentNormalization = 1.0e15;
		    }
		    rwccq.plot(state.zposLarge,state.currentMLarge2,state.currentNormalization,state.currentMIN2,state.currentin2);
		}
    }
    
    public void update3D(){
        try{
		if(Double.valueOf(cp3D.text3.getText()).doubleValue()>=0.0 && 
		   Double.valueOf(cp3D.text3.getText()).doubleValue()<=state.distance_maximum){
		    state.point_distance=Double.valueOf(cp3D.text3.getText()).doubleValue();
		    state.distance = state.point_distance * state.wavelength;
		}
		else if(Double.valueOf(cp3D.text3.getText()).doubleValue()>state.distance_maximum){
		    state.point_distance=state.distance_maximum;
		    state.distance = state.point_distance * state.wavelength;
		    cp3D.text3.setText(""+state.point_distance);
		}
		else{
		    state.point_distance=0.0;
		    state.distance=0.0;
		    cp3D.text3.setText(""+state.point_distance);
		}
	    } 
	    catch(NumberFormatException e){
		  state.point_distance = 0.0;
	    }
	    
	    state.phi_angle = cp3D.slider1.getValue();
	    inputpanel2.slider3.setValue((int)(inputpanel2.ScrollMax2*(state.phi_angle-state.phi_minimum)/
					    (state.phi_maximum-state.phi_minimum)));
	    inputpanel2.slider30.setValue(0);
	    inputpanel2.text2.setText(""+MaestroA.rounder(state.phi_angle,7));
	    
		    state.ignition();
		    state.scan3Dfield();
		    
		    rwccf.setYRangeMax(state.EfieldMax);
		    rwccf.setYRangeMin(0.0);
		    rwccf.plotZeroLine(false);
		    rwccf.plotRefPoint(false);
		    rwccf.setPolar(state.IsPolar);
		    rwccf.setPhiAngle((int)state.phi_angle);
		    rwccf.setType(1);
		    rwccf.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    rwccg.setYRangeMax(state.EfieldphiMax);
		    rwccg.setYRangeMin(0.0);
		    rwccg.plotZeroLine(false);
		    rwccg.plotRefPoint(false);
		    rwccg.setPolar(state.IsPolar);
		    rwccg.setPhiAngle((int)state.phi_angle);
		    rwccg.setType(1);
		    rwccg.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcch.setYRangeMax(state.EfieldRadMax);
		    rwcch.setYRangeMin(0.0);
		    rwcch.plotZeroLine(false);
		    rwcch.plotRefPoint(false);
		    rwcch.setPolar(state.IsPolar);
		    rwcch.setPhiAngle((int)state.phi_angle);
		    rwcch.setType(2);
		    rwcch.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccj.setYRangeMax(state.EfieldphiRadMax);
		    rwccj.setYRangeMin(0.0);
		    rwccj.plotZeroLine(false);
		    rwccj.plotRefPoint(false);
		    rwccj.setPolar(state.IsPolar);
		    rwccj.setPhiAngle((int)state.phi_angle);
		    rwccj.setType(2);
		    rwccj.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcch2.setYRangeMax(state.EfieldPhigenMax);
		    rwcch2.setYRangeMin(0.0);
		    rwcch2.plotZeroLine(false);
		    rwcch2.plotRefPoint(false);
		    rwcch2.setPolar(state.IsPolar);
		    rwcch2.setPhiAngle((int)state.phi_angle);
		    rwcch2.setType(10);
		    rwcch2.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		   		    
		    rwccj2.setYRangeMax(state.EfieldphiPhiMax);
		    rwccj2.setYRangeMin(0.0);
		    rwccj2.plotZeroLine(false);
		    rwccj2.plotRefPoint(false);
		    rwccj2.setPolar(state.IsPolar);
		    rwccj2.setPhiAngle((int)state.phi_angle);
		    rwccj2.setType(10);
		    rwccj2.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcck.setYRangeMax(state.EfieldCartxMax);
		    rwcck.setYRangeMin(0.0);
		    rwcck.plotZeroLine(false);
		    rwcck.plotRefPoint(false);
		    rwcck.setPolar(state.IsPolar);
		    rwcck.setPhiAngle((int)state.phi_angle);
		    rwcck.setType(3);
		    rwcck.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccl.setYRangeMax(state.EfieldCartyMax);
		    rwccl.setYRangeMin(0.0);
		    rwccl.plotZeroLine(false);
		    rwccl.plotRefPoint(false);
		    rwccl.setPolar(state.IsPolar);
		    rwccl.setPhiAngle((int)state.phi_angle);
		    rwccl.setType(4);
		    rwccl.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccm.setYRangeMax(state.EfieldCartzMax);
		    rwccm.setYRangeMin(0.0);
		    rwccm.plotZeroLine(false);
		    rwccm.plotRefPoint(false);
		    rwccm.setPolar(state.IsPolar);
		    rwccm.setPhiAngle((int)state.phi_angle);
		    rwccm.setType(5);
		    rwccm.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccn.setYRangeMax(state.EfieldCart2xMax);
		    rwccn.setYRangeMin(0.0);
		    rwccn.plotZeroLine(false);
		    rwccn.plotRefPoint(false);
		    rwccn.setPolar(state.IsPolar);
		    rwccn.setPhiAngle((int)state.phi_angle);
		    rwccn.setType(3);
		    rwccn.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwcco.setYRangeMax(state.EfieldCart2yMax);
		    rwcco.setYRangeMin(0.0);
		    rwcco.plotZeroLine(false);
		    rwcco.plotRefPoint(false);
		    rwcco.setPolar(state.IsPolar);
		    rwcco.setPhiAngle((int)state.phi_angle);
		    rwcco.setType(4);
		    rwcco.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccp.setYRangeMax(state.EfieldCart2zMax);
		    rwccp.setYRangeMin(0.0);
		    rwccp.plotZeroLine(false);
		    rwccp.plotRefPoint(false);
		    rwccp.setPolar(state.IsPolar);
		    rwccp.setPhiAngle((int)state.phi_angle);
		    rwccp.setType(5);
		    rwccp.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccr.setYRangeMax(state.HfieldMax);
		    rwccr.setYRangeMin(0.0);
		    rwccr.plotZeroLine(false);
		    rwccr.plotRefPoint(false);
		    rwccr.setPolar(state.IsPolar);
		    rwccr.setPhiAngle((int)state.phi_angle);
		    rwccr.setType(6);
		    rwccr.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccr2.setYRangeMax(state.HfieldRadMax);
		    rwccr2.setYRangeMin(0.0);
		    rwccr2.plotZeroLine(false);
		    rwccr2.plotRefPoint(false);
		    rwccr2.setPolar(state.IsPolar);
		    rwccr2.setPhiAngle((int)state.phi_angle);
		    rwccr2.setType(11);
		    rwccr2.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccr3.setYRangeMax(state.HfieldThetaMax);
		    rwccr3.setYRangeMin(0.0);
		    rwccr3.plotZeroLine(false);
		    rwccr3.plotRefPoint(false);
		    rwccr3.setPolar(state.IsPolar);
		    rwccr3.setPhiAngle((int)state.phi_angle);
		    rwccr3.setType(12);
		    rwccr3.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccs.setYRangeMax(state.HfieldphiMax);
		    rwccs.setYRangeMin(0.0);
		    rwccs.plotZeroLine(false);
		    rwccs.plotRefPoint(false);
		    rwccs.setPolar(state.IsPolar);
		    rwccs.setPhiAngle((int)state.phi_angle);
		    rwccs.setType(6);
		    rwccs.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccs2.setYRangeMax(state.HfieldphiRadMax);
		    rwccs2.setYRangeMin(0.0);
		    rwccs2.plotZeroLine(false);
		    rwccs2.plotRefPoint(false);
		    rwccs2.setPolar(state.IsPolar);
		    rwccs2.setPhiAngle((int)state.phi_angle);
		    rwccs2.setType(11);
		    rwccs2.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccs3.setYRangeMax(state.HfieldphiThetaMax);
		    rwccs3.setYRangeMin(0.0);
		    rwccs3.plotZeroLine(false);
		    rwccs3.plotRefPoint(false);
		    rwccs3.setPolar(state.IsPolar);
		    rwccs3.setPhiAngle((int)state.phi_angle);
		    rwccs3.setType(12);
		    rwccs3.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    
		    //-------------------------------------------  new: H cartesian components
		    rwcct.setYRangeMax(state.HfieldCartxMax);
		    rwcct.setYRangeMin(0.0);
		    rwcct.plotZeroLine(false);
		    rwcct.plotRefPoint(false);
		    rwcct.setPolar(state.IsPolar);
		    rwcct.setPhiAngle((int)state.phi_angle);
		    rwcct.setType(7);
		    rwcct.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccu.setYRangeMax(state.HfieldCart2xMax);
		    rwccu.setYRangeMin(0.0);
		    rwccu.plotZeroLine(false);
		    rwccu.plotRefPoint(false);
		    rwccu.setPolar(state.IsPolar);
		    rwccu.setPhiAngle((int)state.phi_angle);
		    rwccu.setType(7);
		    rwccu.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccv.setYRangeMax(state.HfieldCartyMax);
		    rwccv.setYRangeMin(0.0);
		    rwccv.plotZeroLine(false);
		    rwccv.plotRefPoint(false);
		    rwccv.setPolar(state.IsPolar);
		    rwccv.setPhiAngle((int)state.phi_angle);
		    rwccv.setType(8);
		    rwccv.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccw.setYRangeMax(state.HfieldCart2yMax);
		    rwccw.setYRangeMin(0.0);
		    rwccw.plotZeroLine(false);
		    rwccw.plotRefPoint(false);
		    rwccw.setPolar(state.IsPolar);
		    rwccw.setPhiAngle((int)state.phi_angle);
		    rwccw.setType(8);
		    rwccw.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    rwccx.setYRangeMax(state.HfieldCartzMax);
		    rwccx.setYRangeMin(0.0);
		    rwccx.plotZeroLine(false);
		    rwccx.plotRefPoint(false);
		    rwccx.setPolar(state.IsPolar);
		    rwccx.setPhiAngle((int)state.phi_angle);
		    rwccx.setType(9);
		    rwccx.setLabels("\u03c6 = "+((int)state.phi_angle)+"\u00ba plane","V/m","\u03b8  [degrees]");
		    
		    rwccy.setYRangeMax(state.HfieldCart2zMax);
		    rwccy.setYRangeMin(0.0);
		    rwccy.plotZeroLine(false);
		    rwccy.plotRefPoint(false);
		    rwccy.setPolar(state.IsPolar);
		    rwccy.setPhiAngle((int)state.phi_angle);
		    rwccy.setType(9);
		    rwccy.setLabels("\u03b8 = 90.0\u00ba plane","V/m","\u03c6  [degrees]");
		    
		    //---------------------------------------------------------
		    
		    state.Is_theta = true;
		    state.Is_radius = false;
		    
		    rwccf.plot(state.x_polar,state.ethetaM);
		    rwcch.plot(state.x_polar,state.eradM);
		    rwcch2.plot(state.x_polar,state.ephigenM);
		    rwccg.plot(state.x_polar,state.ephiM);
		    rwccj.plot(state.x_polar,state.ephiradM);
		    rwccj2.plot(state.x_polar,state.ephiphiM);
		    rwccr.plot(state.x_polar,state.hphigenM);
		    rwccs.plot(state.x_polar,state.hphiM);
		    
		    rwcck.plot(state.x_polar,state.ex);
		    rwccl.plot(state.x_polar,state.ey);
		    rwccm.plot(state.x_polar,state.ez);
		    rwccn.plot(state.x_polar,state.ephix);
		    rwcco.plot(state.x_polar,state.ephiy);
		    rwccp.plot(state.x_polar,state.ephiz);
		    rwcct.plot(state.x_polar,state.hx);
		    rwccu.plot(state.x_polar,state.hphix);
		    rwccv.plot(state.x_polar,state.hy);
		    rwccw.plot(state.x_polar,state.hphiy);
		    rwccx.plot(state.x_polar,state.hz);
		    rwccy.plot(state.x_polar,state.hphiz);
		    
		    rwccf.ignition();
		    rwccf.repaint();
		    rwccg.ignition();
		    rwccg.repaint();
		    rwcch.ignition();
		    rwcch.repaint();
		    rwccj.ignition();
		    rwccj.repaint();
		    rwcch2.ignition();
		    rwcch2.repaint();
		    rwccj2.ignition();
		    rwccj2.repaint();
		    rwcck.ignition();
		    rwcck.repaint();
		    rwccl.ignition();
		    rwccl.repaint();
		    rwccm.ignition();
		    rwccm.repaint();
		    rwccn.ignition();
		    rwccn.repaint();
		    rwcco.ignition();
		    rwcco.repaint();
		    rwccp.ignition();
		    rwccp.repaint();
		    rwccr.ignition();
		    rwccr.repaint();
		    rwccs.ignition();
		    rwccs.repaint();
		    
		    rwccr2.ignition();
		    rwccr2.repaint();
		    rwccs2.ignition();
		    rwccs2.repaint();
		    
		    rwccr3.ignition();
		    rwccr3.repaint();
		    rwccs3.ignition();
		    rwccs3.repaint();
		    
		    rwcct.ignition();
		    rwcct.repaint();
		    rwccu.ignition();
		    rwccu.repaint();
		    rwccv.ignition();
		    rwccv.repaint();
		    rwccw.ignition();
		    rwccw.repaint();
		    rwccx.ignition();
		    rwccx.repaint();
		    rwccy.ignition();
		    rwccy.repaint();
		    
		    rwc.setField(state.IsEfield);
		    rwc.set3D(true);
		    rwc.repaint();
		    
		    rwc2.setFrequency(state.frequency);
		    rwc2.setEpsilon(state.epsilon_r);
		    rwc2.setWavelength(state.wavelength);
		    rwc2.setTheta(state.theta_angle);
		    rwc2.setPhi(state.phi_angle);
		    rwc2.setDistance(state.point_distance);
    
		    rwc2.repaint();
		    
		    outputpanel2.rwocC.repaint();
		    outputpanel2.rwocD.repaint();
		    outputpanel2.tcanvas.repaint();
		    outputpanel3.rwocE.repaint();
		    outputpanel3.rwocF.repaint();
		    outputpanel3.tcanvas2.repaint();
		    outputpanel4.rwocG.repaint();
		    outputpanel4.rwocH.repaint();
		    outputpanel4.tcanvas3.repaint();
		    outputpanel5.rwocI.repaint();
		    outputpanel5.rwocJ.repaint();
		    outputpanel5.tcanvas4.repaint();
		    
		    outputpanel4b.rwocGb.repaint();
		    outputpanel4b.rwocHb.repaint();
		    outputpanel4b.tcanvas3b.repaint();
		    outputpanel5b.rwocIb.repaint();
		    outputpanel5b.rwocJb.repaint();
		    outputpanel5b.tcanvas4b.repaint();
		    
		    outputpanel6.rwocK.repaint();
		    outputpanel6.rwocL.repaint();
		    outputpanel6.tcanvas5.repaint();
		    outputpanel7.rwocM.repaint();
		    outputpanel7.rwocN.repaint();
		    outputpanel7.tcanvas6.repaint();
		    outputpanel8.rwocO.repaint();
		    outputpanel8.rwocP.repaint();
		    outputpanel8.tcanvas7.repaint();
		    outputpanel9.rwocQ.repaint();
		    outputpanel9.rwocR.repaint();
		    outputpanel9.tcanvas8.repaint();
		    outputpanel10.rwocS.repaint();
		    outputpanel10.rwocT.repaint();
		    outputpanel10.tcanvas9.repaint();
		    outputpanel11.rwocU.repaint();
		    outputpanel11.rwocV.repaint();
		    outputpanel11.tcanvas10.repaint();
		    outputpanel13.rwoc6P.repaint();
		    outputpanel13.rwoc7P.repaint();
		    outputpanel13.tcanvas12.repaint();
		    outputpanel14.rwoc8P.repaint();
		    outputpanel14.rwoc9P.repaint();
		    outputpanel14.tcanvas13.repaint();
		    
		    outputpanel13b.rwoc6Pb.repaint();
		    outputpanel13b.rwoc7Pb.repaint();
		    outputpanel13b.tcanvas12b.repaint();
		    outputpanel14b.rwoc8Pb.repaint();
		    outputpanel14b.rwoc9Pb.repaint();
		    outputpanel14b.tcanvas13b.repaint();
		    
		    outputpanel13c.rwoc6Pc.repaint();
		    outputpanel13c.rwoc7Pc.repaint();
		    outputpanel13c.tcanvas12c.repaint();
		    outputpanel14c.rwoc8Pc.repaint();
		    outputpanel14c.rwoc9Pc.repaint();
		    outputpanel14c.tcanvas13c.repaint();
		    
		    outputpanel15.rwoc10P.repaint();
		    outputpanel15.rwoc11P.repaint();
		    outputpanel15.tcanvas14.repaint();
		    outputpanel16.rwoc12P.repaint();
		    outputpanel16.rwoc13P.repaint();
		    outputpanel16.tcanvas15.repaint();
		    outputpanel17.rwoc14P.repaint();
		    outputpanel17.rwoc15P.repaint();
		    outputpanel17.tcanvas16.repaint();
		    outputpanel18.rwoc16P.repaint();
		    outputpanel18.rwoc17P.repaint();
		    outputpanel18.tcanvas17.repaint();
		    outputpanel19.rwoc18P.repaint();
		    outputpanel19.rwoc19P.repaint();
		    outputpanel19.tcanvas18.repaint();
		    outputpanel20.rwoc20P.repaint();
		    outputpanel20.rwoc21P.repaint();
		    outputpanel20.tcanvas19.repaint();
		    
		    inputpanel2.text4.setText(""+state.point_distance);
		    inputpanel2.slider2.setValue((int)((state.point_distance-state.distance_minimum)*inputpanel2.ScrollMax/(state.distance_maximum-state.distance_minimum)));
		    inputpanel2.repaint();
    }
    
    
    /**
     * Called to start the applet.  You never need to call this directly; it
     * is called when the applet's document is visited.
     */
    public void start() {
    }

    /**
     * Called to stop the applet.  This is called when the applet's document is
     * no longer on the screen.  It is guaranteed to be called before destroy()
     * is called.  You never need to call this method directly
     */
    public void stop() {
    }

    /**
     * Cleans up whatever resources are being held.  If the applet is active
     * it is stopped.
     */
    public void destroy() {
    }
}

