首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

123456789778

后端 46.88KB 9 需要积分: 1
立即下载

资源介绍:

123456789778
package com; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class AddGUI extends JFrame{ //private StudentGui studentGui; private DefaultTableModel tableModel; public AddGUI(StudentGui studentGui) { setResizable(false); setSize(400, 300); // 设置标题 setTitle("新增学生"); setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); JPanel jp1 = new JPanel(); JLabel jl1 = new JLabel("学号:"); JTextField id = new JTextField(10); jp1.setLayout(new FlowLayout()); jp1.add(jl1); jp1.add(id); add(jp1); JPanel jp2 = new JPanel(); JLabel jl2 = new JLabel("姓名:"); JTextField name = new JTextField(10); jp2.setLayout(new FlowLayout()); jp2.add(jl2); jp2.add(name); add(jp2); ButtonGroup bg = new ButtonGroup(); JPanel jp3 = new JPanel(); jp3.setLayout(new FlowLayout()); JLabel jl3 = new JLabel("性别:"); JRadioButton jrb1 = new JRadioButton("男"); JRadioButton jrb2 = new JRadioButton("女"); bg.add(jrb1); bg.add(jrb2); jp3.add(jl3); jp3.add(jrb1); jp3.add(jrb2); add(jp3); //年级 JPanel jp4 = new JPanel(); jp4.setLayout(new FlowLayout()); JLabel jl4 = new JLabel("年级:"); String[] jg = { "一年级", "二年级", "三年级", "四年级" ,"五年级","六年级"}; JComboBox jComboBox = new JComboBox(jg); jp4.add(jl4); jp4.add(jComboBox); add(jp4); //班级 JPanel jp5 = new JPanel(); jp4.setLayout(new FlowLayout()); JLabel jl5 = new JLabel("年级:"); String[] jg2 = { "一班", "二班", "三班"}; JComboBox jComboBox2 = new JComboBox(jg2); jp5.add(jl5); jp5.add(jComboBox2); add(jp5); //出生年月 JPanel jp6 = new JPanel(); JLabel jl6 = new JLabel("出生年月:"); JTextField batch = new JTextField(10); jp6.setLayout(new FlowLayout()); jp6.add(jl6); jp6.add(batch); add(jp6); //保存 JPanel jp7 = new JPanel(); JButton add=new JButton("保存"); jp7.add(add); add.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { String id1 = id.getText().trim(); String name1=name.getText().trim(); String sex=""; String grade=(String) jComboBox.getSelectedItem(); String classname=(String) jComboBox2.getSelectedItem(); String bath1=batch.getText().trim(); if (jrb1.isSelected()) { sex= "男"; } else if (jrb2.isSelected()) { sex= "女"; } SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日"); sdf.setLenient(false); // 严格解析日期 try { Date parse = sdf.parse(bath1); if (!id1.isEmpty()&&!name1.isEmpty()&&!sex.equals("")&&!grade.isEmpty()&&!classname.isEmpty()) { DateBaseUtil dateBaseUtil=new DateBaseUtil(); if (dateBaseUtil.queryStudent(id1).equals("-1")){ dispose();//关闭该窗口 System.out.println(bath1); Student student=new Student(id1,name1,sex,grade,classname,parse); dateBaseUtil.addStudent(student); studentGui.loadStudents(); // saveNameToDatabase(name); JOptionPane.showMessageDialog(AddGUI.this, "保存成功!"); }else { JOptionPane.showMessageDialog(AddGUI.this, "该学号已存在请重新输入!", "错误", JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog(AddGUI.this, "请输入完整信息!", "错误", JOptionPane.ERROR_MESSAGE); } } catch (ParseException e1) { JOptionPane.showMessageDialog(AddGUI.this, "日期格式不正确,请按yyyy年MM月dd日格式重新输入!", "错误", JOptionPane.ERROR_MESSAGE); } catch (SQLException throwables) { throwables.printStackTrace(); } } }); add(jp7); setVisible(true); } }

资源文件列表:

studentinfo1.zip 大约有60个文件
  1. studentinfo1/
  2. studentinfo1/.idea/
  3. studentinfo1/.idea/.gitignore 252B
  4. studentinfo1/.idea/.name 11B
  5. studentinfo1/.idea/compiler.xml 647B
  6. studentinfo1/.idea/jarRepositories.xml 864B
  7. studentinfo1/.idea/libraries/
  8. studentinfo1/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_11_4.xml 581B
  9. studentinfo1/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_28.xml 574B
  10. studentinfo1/.idea/libraries/Maven__org_projectlombok_lombok_1_18_36.xml 531B
  11. studentinfo1/.idea/misc.xml 408B
  12. studentinfo1/.idea/modules.xml 413B
  13. studentinfo1/.idea/studentinfo1.iml 344B
  14. studentinfo1/.idea/workspace.xml 3.1KB
  15. studentinfo1/studentinfo/
  16. studentinfo1/studentinfo/.idea/
  17. studentinfo1/studentinfo/.idea/.gitignore 251B
  18. studentinfo1/studentinfo/.idea/compiler.xml 647B
  19. studentinfo1/studentinfo/.idea/dataSources/
  20. studentinfo1/studentinfo/.idea/dataSources/8f49a314-ce0e-409a-a9c8-ae43fccaf8e5/
  21. studentinfo1/studentinfo/.idea/dataSources/8f49a314-ce0e-409a-a9c8-ae43fccaf8e5/storage_v2/
  22. studentinfo1/studentinfo/.idea/dataSources/8f49a314-ce0e-409a-a9c8-ae43fccaf8e5/storage_v2/_src_/
  23. studentinfo1/studentinfo/.idea/dataSources/8f49a314-ce0e-409a-a9c8-ae43fccaf8e5/storage_v2/_src_/schema/
  24. studentinfo1/studentinfo/.idea/dataSources/8f49a314-ce0e-409a-a9c8-ae43fccaf8e5/storage_v2/_src_/schema/information_schema.FNRwLQ.meta 76B
  25. studentinfo1/studentinfo/.idea/dataSources/8f49a314-ce0e-409a-a9c8-ae43fccaf8e5.xml 120.22KB
  26. studentinfo1/studentinfo/.idea/dataSources.local.xml 967B
  27. studentinfo1/studentinfo/.idea/dataSources.xml 530B
  28. studentinfo1/studentinfo/.idea/jarRepositories.xml 864B
  29. studentinfo1/studentinfo/.idea/libraries/
  30. studentinfo1/studentinfo/.idea/libraries/Maven__com_google_protobuf_protobuf_java_3_11_4.xml 581B
  31. studentinfo1/studentinfo/.idea/libraries/Maven__mysql_mysql_connector_java_8_0_28.xml 574B
  32. studentinfo1/studentinfo/.idea/libraries/Maven__org_projectlombok_lombok_1_18_36.xml 531B
  33. studentinfo1/studentinfo/.idea/misc.xml 466B
  34. studentinfo1/studentinfo/.idea/modules.xml 269B
  35. studentinfo1/studentinfo/.idea/workspace.xml 3.64KB
  36. studentinfo1/studentinfo/pom.xml 1004B
  37. studentinfo1/studentinfo/src/
  38. studentinfo1/studentinfo/src/main/
  39. studentinfo1/studentinfo/src/main/java/
  40. studentinfo1/studentinfo/src/main/java/com/
  41. studentinfo1/studentinfo/src/main/java/com/AddGUI.java 4.97KB
  42. studentinfo1/studentinfo/src/main/java/com/DateBaseUtil.java 4.69KB
  43. studentinfo1/studentinfo/src/main/java/com/Student.java 1.04KB
  44. studentinfo1/studentinfo/src/main/java/com/StudentGui.java 2.02KB
  45. studentinfo1/studentinfo/src/main/java/com/StudentInfo.java 783B
  46. studentinfo1/studentinfo/src/main/resources/
  47. studentinfo1/studentinfo/src/test/
  48. studentinfo1/studentinfo/src/test/java/
  49. studentinfo1/studentinfo/studentinfo.iml 1.12KB
  50. studentinfo1/studentinfo/target/
  51. studentinfo1/studentinfo/target/classes/
  52. studentinfo1/studentinfo/target/classes/com/
  53. studentinfo1/studentinfo/target/classes/com/AddGUI$1.class 3.51KB
  54. studentinfo1/studentinfo/target/classes/com/AddGUI.class 3.04KB
  55. studentinfo1/studentinfo/target/classes/com/DateBaseUtil.class 4.79KB
  56. studentinfo1/studentinfo/target/classes/com/Student.class 3.88KB
  57. studentinfo1/studentinfo/target/classes/com/StudentGui.class 3.45KB
  58. studentinfo1/studentinfo/target/classes/com/StudentInfo.class 1.03KB
  59. studentinfo1/studentinfo/target/generated-sources/
  60. studentinfo1/studentinfo/target/generated-sources/annotations/
0评论
提交 加载更多评论
其他资源 AI中控无人直播助手 关键词+gpt回复+自动讲解
支持抖音、快手、淘宝、小红书等13个平台直播 支持关键词+AI兜底回复 支持接入多平台AI语音 支持抖音直播、淘宝直播、快手直播商品一键采集 支持淘宝直播一键文案生成
C/C++ 语言参考,适合新手使用
基本C/C++ 预处理命令 操作符优先级 转义字符 ASCII码表 基本数据类型 关键字 标准库 函数等
一些c++模板.pdf
一些c++模板.pdf
一些c++模板.pdf 一些c++模板.pdf 一些c++模板.pdf
山大ppt模板.zip
山大ppt模板.zip
上机指导与基础上机题(学生版).zip
上机指导与基础上机题(学生版).zip
上机指导与基础上机题(学生版).zip 上机指导与基础上机题(学生版).zip
Native开发与逆向第七篇 - base64 , demo源码
Native开发与逆向第七篇 - base64 , demo源码。 文章链接:https://blog.csdn.net/u013170888/article/details/144085061
最多跑一次小程序 微信小程序+SSM毕业设计 源码+数据库+论文+启动教程.zip
最多跑一次小程序 微信小程序+SSM毕业设计 源码+数据库+论文+启动教程 项目启动教程:https://www.bilibili.com/video/BV1BfB2YYEnS
足浴城消费系统 微信小程序+SSM毕业设计 源码+数据库+论文+启动教程.zip
足浴城消费系统 微信小程序+SSM毕业设计 源码+数据库+论文+启动教程 项目启动教程:https://www.bilibili.com/video/BV1BfB2YYEnS