/************************************
阴历及节日
程序 2008 beta1
免费软件(Free Software) 你可以无限传播与反编译
该日历有三种外观样式,有从1900年至2049年间的所有阴历
个人爱好开发 作者:朱春 Email:npuxbd@163
Copyright @ 2008- All Rights Reserved
FileName:Simple_Calendar
**********************************/
import java.text.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.border.*;
import java.util.*;
import javax.swing.*;
public class Simple_Calendar extends JFrame implements ActionListener{
public static void main(String[] args) {
SwingConsole.run(new Simple_Calendar(),525,525);
}
public Simple_Calendar() {
setTitle(" 阴历及节日
软件 2008 beta1");
setIconImage(this.getToolkit().createImage("title.gif"));
setResizable(false);
calendar = Calendar.getInstance();
today = calendar.get(Calendar.DAY_OF_MONTH);
panel_Header=initializtion_Header();
panel_Week =initializtion_Week();
panel_Calendar=initializtion_Calendar();
setLayout(null);
setBounds(185,125,0,0);
add(panel_Header);panel_Calendar.setBounds(0 ,0 ,525 , 45);
add(panel_Week); panel_Week.setBounds(0 ,45 ,525 , 35);
add(panel_Calendar);panel_Calendar.setBounds(0 ,80 ,525 , 415) ;
initializtion_Data(calendar);
}
private JPanel initializtion_Header(){//显示表头的panel
JPanel panel = new JPanel();
year_box = new JComboBox();
month_box = new JComboBox();
cross=new JRadioButton("c",false);cross.addActionListener(new LookAndFeel_Listener());
system=new JRadioButton("s",false);system.addActionListener(new LookAndFeel_Listener());
motif=new JRadioButton("m",false);motif.addActionListener(new LookAndFeel_Listener());
feel_group= new ButtonGroup();
show_help = new JButton("说 明");
show_help.addActionListener(new Statement_Listener());
feel_group.add(cross);feel_group.add(system);feel_group.add(motif);
panel.setBorder(new EtchedBorder(5,Color.red,Color.BLUE));
JLabel year_l = new JLabel("请您选择年份: ",JLabel.RIGHT);
JLabel month_l = new JLabel("月份: ",JLabel.RIGHT);
panel.setLayout(null);
panel.setSize(525,45);
for(int i = 1900 ;i < 2050 ; i++)
year_box.addItem(""+i);
for(int j = 1 ; j <= 12 ;j++)
month_box.addItem(""+j) ;
year_box.setSelectedIndex(calendar.get(Calendar.YEAR)-1900);
month_box.setSelectedIndex(calendar.get(Calendar.MONTH));
panel.add(year_l); year_l.setBounds(0,10,95,25);
panel.add(year_box); year_box.setBounds(100,10,65,25);
panel.add(month_l); month_l.setBounds(160,10,45,25);
panel.add(month_box);month_box.setBounds(210,10,45,25);
JLabel look_feel = new JLabel("外观:",JLabel.RIGHT);
panel.add(look_feel);look_feel.setBounds(290-38,10,38,25);
panel
.add(cross); cross.setBounds(290,10,38,25);
panel.add(system); system.setBounds(325,10,32,25);
panel.add(motif); motif.setBounds(355,10,38,25);
panel.add(show_help); show_help.setBounds(400,10,65,25);
show_help.setBorder(new EmptyBorder(0,0,0,0));
show_help.setBackground(Color.getHSBColor(23,21,10));
year_box.addActionListener(this);
month_box.addActionListener(this);
return panel;
}
private JPanel initializtion_Week(){//显示星期的panel
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(1,7));