java万年历拓展成日志记事本 联系客服

发布时间 : 星期二 文章java万年历拓展成日志记事本更新完毕开始阅读b62f7c460740be1e650e9a76

import java.io.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Hashtable; import java.util.Calendar;

class Month extends Box implements ActionListener //控制月份 {

int month;

JTextField showMonth=null; JButton Nmonth,Lmonth; CalendarPad calendar;

public Month(CalendarPad calendar) {

super(BoxLayout.X_AXIS); this.calendar=calendar; showMonth=new JTextField(2); month=calendar.getMonth(); showMonth.setEditable(false); showMonth.setForeground(Color.blue);

showMonth.setFont(new Font(\ Nmonth=new JButton(\下月\Lmonth=new JButton(\上月\add(Lmonth);

add(showMonth); add(Nmonth);

Lmonth.addActionListener(this); Nmonth.addActionListener(this); showMonth.setText(\}

public void setMonth(int month) {

if(month<=12&&month>=1) {

this.month=month; }

else {

this.month=1; }

showMonth.setText(\}

public int getMonth() {

return month; }

public void actionPerformed(ActionEvent e) {