分享一个支持时分秒的Java时间控件
来源:互联网 发布:数据采集与无线传输 编辑:程序博客网 时间:2024/05/17 01:14
最近要做一个支持跨平台桌面应用程序,想都没想就用了Java,可正好要用到时间控件时却发愁了 因为有需要精确的秒钟,网上搜了很多没有找到满意的。就找了个看得过去的开源控件,自己修改了。废话就不多说了,直接上图:
样子是丑了点不过还能用,(*^__^*) 嘻嘻……
这个Look&Feel好一点 不过布局有点乱 暂时不管了
以下是测试代码:
JFrame frame = new JFrame("JDateChooser");JDateChooser dateChooser = new JDateChooser();dateChooser.jcalendar.setNullDateButtonVisible(true);dateChooser.jcalendar.setTodayButtonVisible(true);dateChooser.jcalendar.setDoneButtonVisible(true);dateChooser.jcalendar.setHourSliderVisible(true);dateChooser.jcalendar.setMinuteSliderVisible(true);dateChooser.jcalendar.setSecondSliderVisible(true);// JDateChooser dateChooser = new JDateChooser(null, new Date(), null,// null);//dateChooser.setLocale(new Locale("de"));//dateChooser.setDateFormatString("dd. MMMM yyyy");// dateChooser.setPreferredSize(new Dimension(130, 20));// dateChooser.setFont(new Font("Verdana", Font.PLAIN, 10));dateChooser.setDateFormatString("yyyy-MM-dd HH:mm:ss");// URL iconURL = dateChooser.getClass().getResource(// "/com/toedter/calendar/images/JMonthChooserColor32.gif");// ImageIcon icon = new ImageIcon(iconURL);// dateChooser.setIcon(icon);frame.getContentPane().add(dateChooser);frame.pack();frame.setVisible(true);dateChooser.requestFocusInWindow();frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
源代码下载地址:
http://download.csdn.net/detail/kings988/4660366
- 分享一个支持时分秒的Java时间控件
- 一个 JS简单时间控件【JS时分秒时间控件】
- 带有年月日时分秒的时间控件
- 刚刚做的一个 JS简单时间控件【JS时分秒时间控件】
- jquery时间控件时分秒
- 显示日历和时间的控件 js 时分秒
- 牛B的js 时间控件(年月日时分秒)
- jQuery UI的日期时间控件(年月日时分秒)
- jeecg框架中时间控件时分秒的显示
- 时间控件---带年月日时分秒
- winform 时间控件显示 时分秒
- 时间控件-时分秒/分秒/年月日
- Java获取当前时间的年月日时分秒
- Java获取当前时间的年月日时分秒方法
- java得到前一个月的年月日时分秒
- Java输出当前时间,年月日时分秒
- JS【JS时分秒时间控件】和js 折扣控件
- JS【JS时分秒时间控件】和js 折扣控件
- ios输入的数字如果前面有0,保留去掉0之后的数据
- 如何写任务计划
- 贝叶斯推断及其互联网应用(一):定理简介
- eclipse开发好的项目 部署到Tomcat的过程------->待确认!
- Android基础之文件操作
- 分享一个支持时分秒的Java时间控件
- servlet 上传excel文件
- 充电和库仑计,charge(bq24161) and coulomb(bq27425)
- java.net.SocketException: Too many open files 问题的解决办法
- C#中如何创建xml文件 增、删、改、查 xml节点信息
- LightSwitch 社区&内容汇总 – 2012年9月
- oracle基本数据类型
- force 指令
- JAVA封装Mongodb操作之一:MongoRepository