在数据库中存的有 生日 datetime类型的 例如:1988-03-11 00:00:00:00,让在swing中如何显示出来为 1988-03-11并且在JComboBox显示,在瑞年的时候2月分只有29天,其他年份有28天,1,3,5,7,8,10,12月有31天,4,6,9,10,11月有30天
谢谢各位
谢谢各位
解决方案 »
- java 怎样将查询到的数据库的内容显示在Swing界面上?
- 在一个JFramme窗口上弹出一个模态的对话框,父窗口会不可操作。在这种情况下,鼠标在父窗口上移动,我想得到鼠标在父窗口的Pane上的位置!
- 怎么样把ciString 还原为开始输入的
- 怎么判断用户输入的字符串满足yyyy-MM-dd
- ObjectOutputStream 必顺用到参数FileOutputStream 吗,有没有把一个对象序列化到一个字符串中的啊
- 这是怎么回事?
- 求助:linux下java图形界面中文无法显示
- jdbc连接求教??
- 关于重载、覆盖和多态这三个概念重申。
- @@@@@@ 子类和超类可以放在不同的.java文件中吗?怎样实现? @@@@@
- log4j有没有读取log的方法?因为文件很大,最好不要一次都读进内存再解析的哪种.
- 在一个文件中如何定位位置,并追加或修改字符串?
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = sdf1.format(new Date());
return time;
}//new Date()-系统当前时间
public String getDay(){
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
String day = sdf1.format(new Date());
return day;
}
public DateSpinner(String formatText) {
SpinnerDateModel model = new SpinnerDateModel();
this.setModel(model); DateEditor editor = new DateEditor(this,formatText);
JTextField field = editor.getTextField();
field.setHorizontalAlignment(field.CENTER);
field.setFont(font);
this.setEditor(editor); setOpaque(true);
updateUI();
}
}