package people;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* @BelongsProject: Main
* @BelongsPackage: peopleSystem
* @Author: KKcxy
* @Date: 2022/5/22 10:15
* @Description: (描述)
*/
public class AddFrame extends JFrame {
JLabel jLabel1 = new JLabel("人口普查信息录入");
JLabel jLabel2 = new JLabel("城市");
JLabel jLabel3 = new JLabel("社区");
JLabel jLabel4 = new JLabel("街道");
JLabel jLabel5 = new JLabel("姓名");
JLabel jLabel6 = new JLabel("性别");
JLabel jLabel7 = new JLabel("身份证号");
JTextField jt1 = new JTextField();
JTextField jt2 = new JTextField();
JTextField jt3 = new JTextField();
JTextField jt4 = new JTextField();
JTextField jt5 = new JTextField();
JComboBox<String> jcb = new JComboBox<>();
JButton save = new JButton("保存");
JButton exit = new JButton("关闭");
PopulationDao pd = new PopulationDao();
MyFrame frame;
public void setFont(){
Font font = new Font("黑体",Font.BOLD,35);
jLabel1.setFont(font);
Font font1= new Font("黑体",Font.BOLD,20);
jLabel2.setFont(font1);
jLabel3.setFont(font1);
jLabel4.setFont(font1);
jLabel5.setFont(font1);
jLabel6.setFont(font1);
jLabel7.setFont(font1);
}
public void setCpnBounds(){
jLabel1.setBounds(85,20,350,50);
jLabel2.setBounds(60,95,50,30);
jLabel3.setBounds(60,145,50,30);
jLabel4.setBounds(60,195,50,30);
jLabel5.setBounds(60,245,50,30);
jLabel6.setBounds(60,295,50,30);
jLabel7.setBounds(60,345,100,30);
jt1.setBounds(160,95,250,30);
jt2.setBounds(160,145,250,30);
jt3.setBounds(160,195,250,30);
jt4.setBounds(160,245,250,30);
jt5.setBounds(160,345,250,30);
jcb.setBounds(160,295,250,30);
save.setBounds(130,400,80,40);
exit.setBounds(260,400,80,40);
}
public void init(){
setCpnBounds();
setFont();
add(jLabel1);add(jLabel2);add(jLabel3);add(jLabel4);
add(jLabel5);add(jLabel6);add(jLabel7);add(jt1);
add(jt2);add(jt3);add(jt4);add(jt5);
add(jcb);jcb.addItem("男");jcb.addItem("女");
add(save);add(exit);
save.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String text1 = jt1.getText();
String text2 = jt2.getText();
String text3 = jt3.getText();
String text4 = jt4.getText();
String text5 = (String) jcb.getSelectedItem();
String text6 = jt5.getText();
if (text1.length()==0||text2.length()==0||text3.length()==0||text4.length()==0){
JOptionPane.showMessageDialog(null,"城市,社区,街道,姓名不能为空");
}else {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh-mm-ss");
String format = sdf.format(date);
boolean add = pd.add(text1, text2, text3, text4, text5, text6, format);
if (add){
JOptionPane.showMessageDialog(null,"保存成功!");
setVisible(false);
frame.setTable();
}
}
}
});
exit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setVisible(false);
}
});
}
public AddFrame(MyFrame frame){
this.frame = frame;
setTitle("人口普查信息录入");
init();
setLayout(null);
setSize(500,500);
setLocationRelativeTo(null);
setVisible(true);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于Java+Swing+Mysql人口普查登记系统
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共20个文件
class:9个
java:5个
prefs:2个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
![star](https://csdnimg.cn/release/downloadcmsfe/public/img/star.98a08eaa.png)
温馨提示
系统介绍 该系统实现了查看列表、新增人口信息、删除人口信息 运行环境:eclipse、idea、jdk1.8 详见:https://blog.csdn.net/qq_33037637/article/details/125583454 系统经多次测试,运行无误,请大家放心下载。
资源详情
资源评论
资源推荐
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/JAR.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 20 条
- 1
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
五星资源
- 粉丝: 6108
- 资源: 1639
![benefits](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-1.c8e153b4.png)
下载权益
![privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-2.ec46750a.png)
C知道特权
![article](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-3.fc5e5fb6.png)
VIP文章
![course-privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-4.320a6894.png)
课程特权
![rights](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-icon.fe0226a8.png)
开通VIP
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)
评论7