package com.itheima;
import javax.swing.*;
public class JFrame09 {
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);
//开始时间输入框
JTextField starttime = new JTextField();
starttime.setBounds(50,100,100,20);
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);
jf.add(Endtime);
//确定按钮
JButton Accept=new JButton("确定");
Accept.setBounds(250,180,60,20);
jf.add(Accept);
//添加按钮到窗体中
jf.setVisible(true);
}
}
标签:20,JLabel,查询,add,new,JAVA,jf,考勤,100
From: https://www.cnblogs.com/cy-xt/p/16840173.html