西西軟件園多重安全檢測(cè)下載網(wǎng)站、值得信賴的軟件下載站!
軟件
軟件
文章
搜索

首頁(yè)編程開(kāi)發(fā)java → 比較綜合的陰歷和陽(yáng)歷的java源程序

比較綜合的陰歷和陽(yáng)歷的java源程序

相關(guān)軟件相關(guān)文章發(fā)表評(píng)論 來(lái)源:本站整理時(shí)間:2010/11/16 16:54:04字體大小:A-A+

作者:佚名點(diǎn)擊:197次評(píng)論:8次標(biāo)簽: Java

  • 類型:行業(yè)軟件大。7.3M語(yǔ)言:中文 評(píng)分:10.0
  • 標(biāo)簽:
立即下載
2 頁(yè) 比較陰歷陽(yáng)歷2

   //////////////////////////////////////////////////// 
      this.calendar = calendar;
      today = calendar.get(Calendar.DAY_OF_MONTH);
      int month = calendar.get(Calendar.MONTH);
      int weekindexDay;
   int weekindexMonth;
  
   calendar.set(Calendar.DATE,1);
  
  while(calendar.get(Calendar.MONTH)==month)
  {   weekindexMonth=calendar.get(Calendar.WEEK_OF_MONTH)-1;
      weekindexDay=calendar.get(Calendar.DAY_OF_WEEK)-1;
      int day=calendar.get(Calendar.DAY_OF_MONTH);
      ///////////////////////////////////////////////
      String today_,month_;
      today_ =day < 10?  "0" + day:"" + day;
      month_ =month<10?  "0" +(month+1):""+(month+1);
      Lunar lunar = new Lunar(calendar);
      String lunar_= lunar.toString();
      ///////////////////////////////////////////
      if( null != sFestival.get(month_+today_))
           lunar_="<font color=red>"+sFestival.get(month_+today_);
      ///////
      String wFestival_=month_+(weekindexMonth)+(weekindexDay);
     
      if( null != wFestival.get(wFestival_)){
       lunar_="<font color=red>"+wFestival.get(wFestival_);
       System.out.println(wFestival_);
      }
         
     
     
     
      if( null != lFestival.get(lunar.numeric_md()))
          lunar_="<font color=red>"+lFestival.get(lunar.numeric_md());
     
     
         
      //計(jì)算除夕
      Calendar temp_calendar = Calendar.getInstance();
      temp_calendar.set(calendar.get(Calendar.YEAR),month,day+1);
     
      //temp_calendar.add(Calendar.DAY_OF_MONTH,1);
      Lunar temp_lunar = new Lunar(temp_calendar);
      String temp_str = temp_lunar.numeric_md();
       if(temp_str.equals("0101"))
          lunar_="<font color=red>"+lFestival.get("1299");
      ///計(jì)算除夕結(jié)束
      //////////////////////////////////////////
      String day_str;
      if(day<10) day_str="<html><center><font size=6>"+today_;
      else       day_str="<html><center><font size=6>"+today_;
     
      day_str+="</font><br>"+lunar_;
   
      if(day==today)
         datas[weekindexMonth][weekindexDay].setForeground(Color.GREEN);
      datas[weekindexMonth][weekindexDay].setText(day_str);
      calendar.add(Calendar.DATE,1);
  } 
     
     
     
 /////////////////////////////////////////////////    
    }
    public  void actionPerformed(ActionEvent e){//日期和年份的選擇更新
     int year = Integer.parseInt(year_box.getSelectedItem().toString()) ;
     int month= Integer.parseInt(month_box.getSelectedItem().toString())-1 ;
     calendar.set(year,month,today);
     clear_Data();
        initializtion_Data(calendar);
    }
    class LookAndFeel_Listener implements ActionListener{//選擇外觀的樣式
 public void actionPerformed(ActionEvent ev){
  JRadioButton o = (JRadioButton)ev.getSource();
  String str=o.getText();
  if("c" == str){
   try {UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
            } catch(Exception e) { e.printStackTrace(); }
  }else if("s" == str){
   try{UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
             } catch(Exception e) {e.printStackTrace();}
  }else if("m" == str){
   try{UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");}
            catch(Exception e) {e.printStackTrace(); }
  }
  SwingUtilities.updateComponentTreeUI(Simple_Calendar.this);
   }
 
    }
    class Statement_Listener implements ActionListener{//顯示聲明信息
     JDialog dialog=null;
     public void actionPerformed(ActionEvent ev){
        String statment = "<html>陰歷及節(jié)日程序 2008 beta1";
         statment +="<br>免費(fèi)軟件(Free Software) 你可以無(wú)限傳播與反編譯.";
         statment +="<br>該日歷有三種外觀樣式,有從1900年至2049年間的所有陰歷.";
         statment +="<br>個(gè)人愛(ài)好開(kāi)發(fā)  作者:朱春 Email:npuxbd@163.com";
         statment +="<br>Copyright @ 2008- All Rights Reserved";
        dialog=new  JDialog(Simple_Calendar.this, "陰歷及節(jié)日軟件 2008 beta1",true);
              dialog.setLayout(null);
              dialog.setBounds(285,215,365,185);
              JLabel label_s = new JLabel(statment);//label_s.setBackground(Color.RED);
              JButton button=new JButton("確 定");
              button.addActionListener(new ActionListener(){
               public void actionPerformed(ActionEvent evet){
                  dialog.setVisible(false);
               }
              });
              dialog.add(label_s);label_s.setBounds(20,0,365,100);
              dialog.add(button);  button.setBounds(145,110,65,25);
              dialog.setVisible(true);
       }
     
    }
    class List_MouseListener implements MouseListener{//鼠標(biāo)移入時(shí)顯示的信息
     JLabel labe=null;
     String weeks[]={"星期日","星期一","星期二","星期三",
                                  "星期四","星期五","星期六"};
                                 


        public String constellation(Calendar cal){
  
                String [][]con ={
                     {"水瓶座","0122","0221"},
                     {"雙魚座","0222","0321"},
                     {"白羊座","0322","0420"},
                     {"金牛座","0421","0521"},
                     {"雙子座","0522","0621"},
                     {"巨蟹座","0621","0721"},
                     {"獅子座","0722","0821"},
                     {"處女座","0822","0921"}, 
                     {"天秤座","0922","1021"},
                     {"天蝎座","1022","1121"},
                     {"射手座","1122","1221"},
                     {"摩羯座","1222","0121"}};
                int month=cal.get(Calendar.MONTH)+1;
                int today=cal.get(Calendar.DAY_OF_MONTH);
                String month_str=month<10?"0"+month:""+month;
                String today_str=today<10?"0"+today:""+today;
                String str=month_str+today_str;
                for( int i = 0 ; i < con.length-1 ; i++ )
                {
                     if(Integer.parseInt(str) >= Integer.parseInt(con[i][1]) && Integer.parseInt(str) <= Integer.parseInt(con[i][2]))
                        return con[i][0]; 
                 
                }
                if((Integer.parseInt(str) >= Integer.parseInt(con[11][1]) && Integer.parseInt(str) < 1232) ||  Integer.parseInt(str) <=Integer.parseInt( con[11][2]) )
                   return  con[11][0];
       
               return "error!";
        }
       
     public void mouseClicked(MouseEvent e) {//鼠標(biāo)按鍵在組件上單擊(按下并釋放)時(shí)調(diào)用。
        
        }    
        public void mouseEntered(MouseEvent e) {//鼠標(biāo)進(jìn)入到組件上時(shí)調(diào)用。
             labe=(JLabel)e.getSource();
             String lab =labe.getText();
             if(lab != ""){
              labe.setBackground(Color.red);
              String day=lab.substring(lab.indexOf("size=6>")+7,lab.indexOf("</font>"));
                //String lun=lab.substring(lab.indexOf("<br>")+4);
                String message = "<html><body><center>公元 "+year_box.getSelectedItem()+"年"+
                                 month_box.getSelectedItem()+"月"+Integer.parseInt(day)+"日";
                calendar.set(Integer.parseInt(year_box.getSelectedItem().toString()),
                             Integer.parseInt(month_box.getSelectedItem().toString())-1,
                             Integer.parseInt(day));
                Lunar lunar=new Lunar(calendar);
                message+="<br><font color=red>"+weeks[(calendar.get(calendar.DAY_OF_WEEK)-1)];
                message+="&nbsp;&nbsp;&nbsp;&nbsp;"+constellation(calendar)+"</font><br>農(nóng)歷 ";
                message+=lunar.get_month()+"月"+lunar.get_Big_Or_Small()+"&nbsp;&nbsp;&nbsp;&nbsp;"+lunar.get_date()+"日";
                //message+=lunar.get_JQ();
                labe.setToolTipText(message);
                labe.setBackground(Color.BLUE);
                labe.setOpaque(true);
               // System.out.println(day+":"+lun);
             }
            
        } 
        public void mouseExited(MouseEvent e) {//  鼠標(biāo)離開(kāi)組件時(shí)調(diào)用。
                  
        
                        labe.setBackground(null);
                        labe.setOpaque(true);
        }
        public void mousePressed(MouseEvent e) {//  鼠標(biāo)按鍵在組件上按下時(shí)調(diào)用。
       
        }
        public void mouseReleased(MouseEvent e) {//  鼠標(biāo)按鈕在組件上釋放時(shí)調(diào)用。
        }


    }
    /////////////////////////////////////////////////////////
    private JLabel datas[][]=new JLabel[6][7];//顯示一月的日期
    private JLabel temp_label=null;
    private  JLabel label=null;
    private JPanel panel_Header,panel_Week,panel_Calendar;
    private Calendar calendar=null;
    private  JComboBox  year_box = null ;
    private  JComboBox month_box = null ;
    private int today ;
    private JRadioButton cross=null,system=null,motif=null;
    private ButtonGroup feel_group=null;
    private JButton show_help =null;
   
     
}


 

    PPT圖表
    (111)PPT圖表
    我們?cè)谥谱鞲黝惖臅r(shí)候,或多或少的都能用到圖表。圖表它可以直觀的展示出各種信息數(shù)據(jù),有了圖表你就可以很好的將數(shù)據(jù)更直觀準(zhǔn)確的表達(dá)出來(lái)。小編在這里為大家搜集整理了一些大家可能會(huì)用到的圖表模板,歡迎有需要的各位前來(lái)下載。...更多>>

    相關(guān)評(píng)論

    閱讀本文后您有什么感想? 已有人給出評(píng)價(jià)!

    • 8 喜歡喜歡
    • 3 頂
    • 1 難過(guò)難過(guò)
    • 5 囧
    • 3 圍觀圍觀
    • 2 無(wú)聊無(wú)聊

    熱門評(píng)論

    最新評(píng)論

    發(fā)表評(píng)論 查看所有評(píng)論(8)

    昵稱:
    表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
    字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過(guò)審核才能顯示)