随便输入年份和月份,即会出现次月的日历 int year=0; int month=0; year=Integer.parseInt(JOptionPane.showInputDialog("请输入年份:")); month=Integer.parseInt(JOptionPane.showInputDialog("请输入月份:")); Calender cal=new Calender(year,month);