⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timetable.java

📁 日历
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		b8=new Button("EXT3");
		b8.disable();
		gen1.add(b8);		
		Label empty1=new Label("   ");
		gen1.add(empty1);
		cppp.add(gen1);


	/* specific in center */
		Panel spec1=new Panel(new GridLayout(1,12,5,5));
		c8=new Checkbox("specific",ccc,false);
		c8.addItemListener(this);
		c8.disable();
		spec1.add(c8);
		check4=new Checkbox("");
		check4.addItemListener(this);
		spec1.add(check4);
		l0=new Label("day");
		l0.disable();
		spec1.add(l0);
		ch2=new Choice();
		ch2.add("monday");
		ch2.add("tuesday");
		ch2.add("thursday");
		ch2.add("wednesday");
		ch2.add("friday");
		ch2.add("saturday");
		ch2.add("sunday");
		ch2.disable();
		spec1.add(ch2);
		check5=new Checkbox("",cg,true);
		check5.addItemListener(this);
		spec1.add(check5);
		l9=new Label("Session");
		l9.disable();
		spec1.add(l9);
		ch6=new Choice();
		ch6.add("session-I");
		ch6.add("session-II");
		ch6.disable();
		spec1.add(ch6);
		check6=new Checkbox("",cg,false);
		check6.addItemListener(this);
		spec1.add(check6);
		l10=new Label("Period");
		l10.disable();
		spec1.add(l10);
		ch10=new Choice();
		ch10.disable();
		spec1.add(ch10);
		b9=new Button("CONT4");
		b9.disable();
		spec1.add(b9);
		b10=new Button("EXT4");
		b10.disable();
		spec1.add(b10);
		spec1.add(ch50);
		cppp.add(spec1);
		Panel extending2=new Panel();
		cppp.add(extending2);


	/* generic in south */		
		Panel gen2=new Panel(new GridLayout(1,13,5,5));
		c9=new Checkbox("generic");
		c9.addItemListener(this);
		c9.disable();
		gen2.add(c9);
    		check7=new Checkbox("",ng,true);
		check7.addItemListener(this);
		gen2.add(check7);
		l11=new Label("day");
		l11.disable();
		gen2.add(l11);
		ch3=new Choice();
		ch3.add("monday");
		ch3.add("tuesday");
		ch3.add("thursday");
		ch3.add("wednesday");
		ch3.add("friday");
		ch3.add("saturday");
		ch3.disable();
		gen2.add(ch3);
    		check8=new Checkbox("",ng,false);
		check8.addItemListener(this);
		gen2.add(check8);
		l12=new Label("Session");
		l12.disable();
		gen2.add(l12);
		ch7=new Choice();
		ch7.add("session-I");
		ch7.add("session-II");
		ch7.disable();
		gen2.add(ch7);
		check9=new Checkbox("",ng,false);
		check9.addItemListener(this);
		gen2.add(check9);
		l13=new Label("forPeriod");
		l13.disable();
		gen2.add(l13);
		ch11=new Choice();
                ch11.disable();
		gen2.add(ch11);
		b11=new Button("CONT5");
		b11.disable();
		gen2.add(b11);
		b12=new Button("EXT5");
		b12.disable();
		gen2.add(b12);
		Label empty2=new Label("   ");
		gen2.add(empty2);
		cpppp.add(gen2);

	/* specific in south */
		Panel spec2=new Panel(new GridLayout(1,13,5,5));
		c10=new Checkbox("specific");
		c10.disable();
		c10.addItemListener(this);
		spec2.add(c10);
		check10=new Checkbox("");
		check10.addItemListener(this);
		spec2.add(check10);
		l14=new Label("day");
		l14.disable();
		spec2.add(l14);
		ch4=new Choice();
		ch4.add("monday");
		ch4.add("tuesday");
		ch4.add("thursday");
		ch4.add("wednesday");
		ch4.add("friday");
		ch4.add("saturday");
		ch4.disable();
		spec2.add(ch4);
		check11=new Checkbox("",og,true);
		check11.addItemListener(this);
		spec2.add(check11);
		l15=new Label("forSession");
		l15.disable();
		spec2.add(l15);
		ch8=new Choice();
		ch8.add("session-I");
		ch8.add("session-II");
		ch8.disable();
		spec2.add(ch8);
		check12=new Checkbox("",og,false);
		check12.addItemListener(this);
		spec2.add(check12);
		l16=new Label("forPeriod");
		l16.disable();
		spec2.add(l16);
		ch12=new Choice();
		//ch10=new Choice();
		ch12.disable();
		spec2.add(ch12);
		b13=new Button("CONT6");
		b13.disable();
		spec2.add(b13);
		b14=new Button("EXT6");
		b14.disable();
		spec2.add(b14);
		Label empty3=new Label("   ");
		spec2.add(empty3);
		cpppp.add(spec2);
		Panel extending3=new Panel();
		cpppp.add(extending3);
				

this.add(cp);
setVisible(true);
b17.disable();
b1.disable();

           	cp.disable();
            	np.disable();

l0.disable();
l1.disable();
l2.disable();
l3.disable();

c1.disable();
c2.disable();
c3.disable();
c4.disable();
c5.disable();
c6.disable();

ch30.disable();
//ch40.disable();
b30.disable();
l30.disable();
check1.disable();
check2.disable();
check3.disable();
check4.disable();
check5.disable();
check6.disable();
                check7.disable();
check8.disable();
check9.disable();
check10.disable();
check11.disable();
check12.disable();
ddd.addKeyListener(this);

                 b7.addActionListener(this);
b8.addActionListener(this);
b9.addActionListener(this);
b10.addActionListener(this);
b11.addActionListener(this);
                b12.addActionListener(this);
b13.addActionListener(this);
b14.addActionListener(this);
b5.addActionListener(this);
b6.addActionListener(this);
for(int i=0;i< 300;i++)
{
bb[i]=new backtrack();

}
add(sp,BorderLayout.SOUTH);
	}
	public void class_init()
	{
		if(init_counter==0)
		{
       			System.out.println("intit counter enrtedred");
	 		subject[counter_class][serial_no]=new time_table();
		}
	}

public void actionPerformed(ActionEvent e)
	{
      String s1="status bar:   ";
         System.out.println("action perfomed");
     try
     {
  		//s=e.getActionCommand();
         	Button check=(Button)e.getSource();
                if(check==b7)
                 {
                 lab.setText(s1+"cont3 is clicked");
                 subject[counter_class][serial_no].specialBit=1;
                 //System.out.println("counter class and serial no"+counter_class+serial_no);
                 if(check1.getState())
                  {
                   	subject[counter_class][serial_no].e[no_of_general_period][0]=ch1.getSelectedItem();
                  }
                   if(check2.getState())
                   {
                    	subject[counter_class][serial_no].e[no_of_general_period][1]=ch5.getSelectedItem();
                   }
                    if(check3.getState())
                    {
		    	subject[counter_class][serial_no].e[no_of_general_period][2]=ch9.getSelectedItem();
                      }
                      no_of_general_period ++;
                    //  qqq.app(" no of general period "+no_of_general_period);
                    subject[counter_class][serial_no].no_of_general_period=no_of_general_period;
		               ddd.app("general day"+ subject[counter_class][serial_no].e[no_of_general_period-1][0]);
                    ddd.app("general sessoion"+subject[counter_class][serial_no]. e[no_of_general_period-1][1]);
                   ddd.app("general period"+subject[counter_class][serial_no]. e[no_of_general_period-1][2]);

		c4.setState(false);  
		c4.disable();
                

                  }
               if(check==b8)
                  {
                lab.setText(s1+(b8.getLabel()).toLowerCase()+" is clicked");
                subject[counter_class][serial_no].specialBit=1;
                        if(check1.getState())
                  	{
                   		subject[counter_class][serial_no].e[no_of_general_period][0]=ch1.getSelectedItem();
                  	}
                   	if(check2.getState())
                   	{
                    		subject[counter_class][serial_no].e[no_of_general_period][1]=ch5.getSelectedItem();
                   	}
                    	if(check3.getState())
                    	{
		    		subject[counter_class][serial_no].e[no_of_general_period][2]=ch9.getSelectedItem();
                      	}
                    //	subject[counter_class][serial_no].no_of_general_period=no_of_general_period;
		    	ddd.app("general day"+ subject[counter_class][serial_no].e[no_of_general_period][0]);
                    	ddd.app("general sessoion"+subject[counter_class][serial_no]. e[no_of_general_period][1]);
                    	ddd.app("general period"+subject[counter_class][serial_no]. e[no_of_general_period][2]);
                    	no_of_general_period ++;
                      	subject[counter_class][serial_no].no_of_general_period=no_of_general_period;
                    //	subject[counter_class][serial_no].no_of_general_period=no_of_general_period;
        		ddd.app("no of subject "+subject[counter_class][serial_no].no_of_general_period);
        	       	no_of_general_period=0;

  	                b7.disable(); b8.disable();
                        c4.setState(false);    
			c4.disable();
                    
                   }
		if(check==b9)
		{
    lab.setText(s1+(b9.getLabel()).toLowerCase()+" is clicked");
                 int period=0,res=0;
                 boolean day=false;
                day=check4.getState();
               // ddd.app("dayy" +day);
                if(day==false)
                {
                 res=-2;
                }

                if(res != -2)
                {
                    try {
                        period=Integer.parseInt(ch50.getSelectedItem());
                    }
                    catch(Exception ae)
                    {
                        qqq.add(" "+ae);
                    }
                    res=period_validation(period);
                }
                if(res==1)
                {
                 cont_enter=1;
                  subject[counter_class][serial_no].specialBit=1;
		  if(check4.getState())
                  {
                   	subject[counter_class][serial_no].b[no_of_specific_period][0]=ch2.getSelectedItem();
                  }

                   if(check5.getState())
                   {
                    	subject[counter_class][serial_no].b[no_of_specific_period][1]=ch6.getSelectedItem();
                   }
                    if(check6.getState())
                    {
		    	subject[counter_class][serial_no].b[no_of_specific_period][2]=ch10.getSelectedItem();
                    }

		    System.out.println("specific day"+ subject[counter_class][serial_no].b[no_of_specific_period][0]);
                    System.out.println("specific sessoion"+subject[counter_class][serial_no]. b[no_of_specific_period][1]);
                    System.out.println(" specific period"+subject[counter_class][serial_no]. b[no_of_specific_period][2]);
		    subject[counter_class][serial_no].specific_continuous[no_of_specific_period]=period;
		    //	System.out.prinln("no of specific period"+no_of_specific_period);
		    //	System.out.prinln("no of continous period"+subject[counter_class][serial_no].specific_continuous[no_of_specific_period]);
                    no_of_specific_period ++;
                    subject[counter_class][serial_no].no_of_specific_period=no_of_specific_period;
                   }
                else
                  {
                   if(res==-1)
                   {

                    qqq.add("CONTINOUS PERIOD OVERFLOW ERROR");
                   }
                   if(res==-2)
                   {
                    qqq.add("SPECIFIC DAY NOT SELECTED");
                   }

                  }
 		  c4.setState(false);  
		  c4.disable();

		}
		if(check==b10)
		{
    lab.setText(s1+(b10.getLabel()).toLowerCase()+" is clicked");
                  int period=0,res=0;
                 boolean day=false;
                day=check4.getState();
                //ddd.app("dayy" +day);
                if(day==false)
                {
                 res=-2;
                }

                if(res != -2)
                {
                try {
                period=Integer.parseInt(ch50.getSelectedItem());
                }
                catch (Exception be)
                {
                qqq.add(" "+be);
                }
                res=period_validation(period);
                }

                 if(res==1)
                {

                  cont_enter=1;
		  if(check4.getState())
                  {
                   	subject[counter_class][serial_no].b[no_of_specific_period][0]=ch2.getSelectedItem();
                  }
                   if(check5.getState())
                   {
                    	subject[counter_class][serial_no].b[no_of_specific_period][1]=ch6.getSelectedItem();
                   }
                    if(check6.getState())
                    {
		    	subject[counter_class][serial_no].b[no_of_specific_period][2]=ch10.getSelectedItem();
                      }
                    subject[counter_class][serial_no].no_of_specific_period=no_of_specific_period;
		    System.out.println("specific day"+ subject[counter_class][serial_no].b[no_of_specific_period][0]);
                    System.out.println("specific sessoion"+subject[counter_class][serial_no]. b[no_of_specific_period][1]);

                    System.out.println(" specific period"+subject[counter_class][serial_no]. b[no_of_specific_period][2]);
                 try {
				        		subject[counter_class][serial_no].specific_continuous[no_of_specific_period]=Integer.parseInt(ch50.getSelectedItem());
                    }
                  catch(Exception ce)
                  {
                      qqq.add(" "+ce);
                  }
                    no_of_specific_period ++;

	            subject[counter_class][serial_no].no_of_specific_period=no_of_specific_period;
        	    System.out.println("no of subject "+subject[counter_class][serial_no].no_of_specific_period);
        	    no_of_specific_period=0;
                    b9.disable();
                    b10.disable();
                  }
                  else
                  {
                     if(res==-1)
                   {

                    qqq.add("CONTINOUS PERIOD OVERFLOW ERROR");
                   }
                   if(res==-2)
                   {
                    qqq.add("SPECIFIC DAY NOT SELECTED");
                   }

                  }
                c4.setState(false);  
		c4.disable();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -