java日历和钟表代码
答案:2 悬赏:50 手机版
解决时间 2021-04-13 08:22
- 提问者网友:却不属于对方
- 2021-04-13 02:39
java日历和钟表代码
最佳答案
- 五星知识达人网友:低血压的长颈鹿
- 2021-04-13 03:13
import hysun.util.MonthlyCalendar;
import javax.swing.*;
import java.awt.*;
public class TestMC extends JFrame {
public TestMC() {
final JTextField textfield = new JTextField();
getContentPane().add(textfield, BorderLayout.NORTH);
MonthlyCalendar mc = new MonthlyCalendar() {
protected void dateSelected() {
textfield.setText(getYear()+"."+getMonth()+"."+getSelectedDay());
}
};
mc.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
mc.setYearMonth(2005, 2);
getContentPane().add(mc);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setLocationRelativeTo(null);
}
public static void main(String args[]) {
new TestMC().setVisible(true);
}
}
import javax.swing.*;
import java.awt.*;
public class TestMC extends JFrame {
public TestMC() {
final JTextField textfield = new JTextField();
getContentPane().add(textfield, BorderLayout.NORTH);
MonthlyCalendar mc = new MonthlyCalendar() {
protected void dateSelected() {
textfield.setText(getYear()+"."+getMonth()+"."+getSelectedDay());
}
};
mc.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
mc.setYearMonth(2005, 2);
getContentPane().add(mc);
setDefaultCloseOperation(EXIT_ON_CLOSE);
pack();
setLocationRelativeTo(null);
}
public static void main(String args[]) {
new TestMC().setVisible(true);
}
}
全部回答
- 1楼网友:归鹤鸣
- 2021-04-13 04:12
北大青鸟一期Java 学习指导课?
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯