资源简介
JavaAWT和MySQL实现学生信息管理系统,Java和MySQL实现学生信息管理系统

代码片段和文件信息
package com.edu.imau;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.Jframe;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.text.BadLocationException;
public class StudentInfoManager extends Jframe {
private static final long serialVersionUID = 1L;
private JPanel panel;
private JButton button1 button2 button3;
private JTextArea text1 text2 text3;
private String[] top={“id““name““age“};
private static String[][] data=new String[20][3];
JTable table = new JTable(data top);
JScrollPane scrollPane = new JScrollPane(table);
//table.setFillsViewportHeight(true);
public StudentInfoManager() throws BadLocationException SQLException {
super(“学生信息管理系统“);
this.setSize(500 340);
findInfo();
this.add(scrollPane BorderLayout.CENTER);
this.add(getJPanel() BorderLayout.SOUTH);
this.setResizable(true);
this.setLocation(300 300);
this.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
}
private JPanel getJPanel() {
if (panel == null) {
panel = new JPanel();
panel.setLayout(new GridLayout(2 3));
text1 = new JTextArea();
text2 = new JTextArea();
text3 = new JTextArea();
button1 = new JButton(“add“);
button2 = new JButton(“delete“);
button3 = new JButton(“update“);
button1.addActionListener(new insert());
button2.addActionListener(new delete());
button3.addActionListener(new update());
text1.setBorder(BorderFactory.createLineBorder(Color.gray 2));
text2.setBorder(BorderFactory.createLineBorder(Color.gray 2));
text3.setBorder(BorderFactory.createLineBorder(Color.gray 2));
text1.setFont(new Font(“宋体“ Font.BOLD 16));
text2.setFont(new Font(“宋体“ Font.BOLD 16));
text3.setFont(new Font(“宋体“ Font.BOLD 16));
text1.setText(“id“);
text2.setText(“name“);
text3.setText(“age“);
panel.add(text1);
panel.add(text2);
panel.add(text3);
panel.add(button1);
panel.add(button2);
panel.add(button3);
}
return panel;
}
class insert implements ActionListener{
public void actionPerformed(ActionEvent e) {
if(text1.getText().equals(“ “)||text2.getTex
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 619 2017-04-08 09:35 1学生信息管理系统\stu.sql
文件 8220 2017-04-08 09:33 1学生信息管理系统\StudentInfoManager.java
目录 0 2017-04-08 09:35 1学生信息管理系统
----------- --------- ---------- ----- ----
8839 3
- 上一篇:jni数值传递
- 下一篇:协同过滤推荐系统 Java
相关资源
- 微博系统(Java源码,servlet+jsp),适
- java串口通信全套完整代码-导入eclip
- jsonarray所必需的6个jar包.rar
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
评论
共有 条评论