文章作者 100test 发表时间 2007:09:06 11:53:28
来源 100Test.Com百考试题网
此主题相关图片如下:
/*
* DateChooser.Java
*
* Created on 2007年8月22日, 下午6:07
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
import Java.awt.BasicStroke.
import Java.awt.BorderLayout.
import Java.awt.Color.
import Java.awt.Component.
import Java.awt.Cursor.
import Java.awt.Dimension.
import Java.awt.Font.
import Java.awt.Graphics.
import Java.awt.Graphics2D.
import Java.awt.GridLayout.
import Java.awt.Point.
import Java.awt.Polygon.
import Java.awt.Stroke.
import Java.awt.Toolkit.
import Java.awt.event.FocusEvent.
import Java.awt.event.FocusListener.
import Java.awt.event.MouseAdapter.
import Java.awt.event.MouseEvent.
import Java.awt.event.MouseListener.
import Java.awt.event.MouseMotionListener.
import Java.text.SimpleDateFormat.
import Java.util.ArrayList.
import Java.util.Calendar.
import Java.util.Comparator.
import Java.util.Date.
import Java.util.List.
import Javax.swing.BorderFactory.
import Javax.swing.JButton.
import Javax.swing.JFrame.
import Javax.swing.JLabel.
import Javax.swing.JPanel.
import Javax.swing.Popup.
import Javax.swing.PopupFactory.
import Javax.swing.SwingUtilities.
import Javax.swing.event.AncestorEvent.
import Javax.swing.event.AncestorListener.
/**
*
* @author hadeslee
*/
public class DateChooser extends JPanel{
private Date initDate.
private Calendar now=Calendar.getInstance().
private Calendar 0select.
private JPanel monthPanel.//月历
private JP1 jp1.//四块面板,组成
private JP2 jp2.
private JP3 jp3.
private JP4 jp4.
private Font font=new Font("宋体",Font.PLAIN,12).
private final LabelManager lm=new LabelManager().
private JLabel showDate.//,toSelect.
private SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日").
private boolean isShow=false.
private Popup pop.
/**
* Creates a new instance of DateChooser
*/
public DateChooser() {
this(new Date()).
}
public DateChooser(Date date){
initDate=date.
0select=Calendar.getInstance().
0select.setTime(initDate).
initPanel().
initLabel().
}
public void setEnabled(boolean b){
super.setEnabled(b).
showDate.setEnabled(b).
}
/**
*得到当前选择框的日期
*/
public Date getDate(){
return 0select.getTime().
}
相关文章
在Weblogic上配置Hibernate为JNDI
Acegi框架技术详细介绍
对J2EE中的DAO组件编写单元测试
ring2.0 JRuby快速入门
JAVA写的日期选择器
有效创建oracledblink的两种方式
JS中将字符串转为XML并读取对象的值
JavaSE6基于JSR105的XML签名之实践篇
用纯JAVA语言编程读取MAC地址的实现
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛