JAVA-考勤查询日历控件

package com.itheima;

import javax.swing.*;

public class JFrame10 {
    public static void main(String[] args) {
        JFrame jf=new JFrame();
        jf.setTitle("考勤查询");
        jf.setSize(400,300);
        jf.setDefaultCloseOperation(3);
        jf.setLocationRelativeTo(null);
        jf.setAlwaysOnTop(true);
        jf.setLayout(null);        //取消窗体的默认布局

        //显示考勤日期
        JLabel  riqilabel=new JLabel("考勤日期");
        riqilabel.setBounds(50,20,100,20);
        jf.add(riqilabel);

        //显示开始时间
        JLabel stratshijian=new JLabel("开始时间");
        stratshijian.setBounds(50,70,100,20);
        jf.add(stratshijian);

        DateChooser dateChooser1 = DateChooser.getInstance("yyyy/MM/dd");
        DateChooser dateChooser2 = DateChooser.getInstance("yyyy/MM/dd");

        //开始时间输入框
        JTextField starttime = new JTextField();
        starttime.setBounds(50,100,100,20);
        dateChooser1.register(starttime);
        jf.add(starttime);


        //结束时间
        JLabel endshijian=new JLabel("结束时间");
        endshijian.setBounds(250,70,100,20);
        jf.add(endshijian);

        //结束时间输入框
        JTextField Endtime =new JTextField();
        Endtime.setBounds(250,100,100,20);
        dateChooser2.register(Endtime);
        jf.add(Endtime);

        //确定按钮
        JButton Accept=new JButton("确定");
        Accept.setBounds(250,180,60,20);
        jf.add(Accept);













        //添加按钮到窗体中
        jf.setVisible(true);


    }
}

image

posted @ 2022-10-29 23:22  NiceTwocu  阅读(29)  评论(0编辑  收藏  举报