import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Scanner;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.Border;
import javax.swing.border.EtchedBorder;
public class TestRiLi extends JFrame{
boolean flag =false;
JPanel j1 = new JPanel();
JPanel j2 = new JPanel();
JTextArea j11 =new JTextArea();
JLabel j21 =new JLabel("选择年份");
JComboBox jbb1;
JLabel j22 =new JLabel("选择月份");
JComboBox jbb2;
String[] years;
String[] months;
String value1;
String value2;
int year =2000;
int month=1;
String a ="日\t一\t二\t三\t四\t五\t六";
Border border = new EtchedBorder(//浮雕化边框
EtchedBorder.RAISED, Color.white, new Color(148, 145, 140));
public TestRiLi(){
years =new String[20];
months =new String[12];
for(int i=0;i<years.length;i++){
years[i]=String.valueOf(2000+i);
}
for(int i=0;i<months.length;i++){
months[i]=String.valueOf(i+1);
}
jbb1 =new JComboBox(years);
jbb2 =new JComboBox(months);
jbb1.setEditable(false);
jbb2.setEditable(false);
}
public void luanchFrame(){
this.setSize(700, 300);
this.setLocation(100, 100);
this.setResizable(false);
add(j1,new BorderLayout().CENTER);
add(j2,new BorderLayout().EAST);
j1.add(j11);
j1.setBorder(border);
//j1.setBackground(Color.CYAN);
j2.setLayout(new GridLayout(4,1));
j2.add(j21);
j2.setBorder(border);
j2.add(jbb1);
j2.setBorder(border);
j2.add(j22);
j2.setBorder(border);
j2.add(jbb2);
j2.setBorder(border);
this.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent arg0) {
System.exit(0);
}
});
this.setVisible(true);
ss();
}
public static void main(String[] args){
new TestRiLi().luanchFrame();
}
public void ss(){
jbb1.addItemListener(new ItemListener(){