您的位置:首页 > 编程语言 > Java开发

学生管理系统java简单实现

2017-12-21 10:22 766 查看
import javax.swing.*;

import java.awt.*;

import java.util.Vector;

public class Test extends JFrame{

Vector rowData,columnNames;

JTable jt=null;

JScrollPane jsp=null;

public Test() {

columnNames=new Vector();

columnNames.add("学号");

columnNames.add("名字");

columnNames.add("性别");

columnNames.add("年龄");

columnNames.add("籍贯");

columnNames.add("系别");

rowData=new Vector();

//rowData可以存放多行数据

Vector hangfirst=new Vector();

hangfirst.add("1");

hangfirst.add("2");

hangfirst.add("3");

hangfirst.add("4");

hangfirst.add("5");

hangfirst.add("6");

rowData.add(hangfirst);

jt=new JTable(rowData,columnNames);

jsp=new JScrollPane(jt);

this.add(jsp);

this.setSize(300,400);

this.setVisible(true);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// TODO Auto-generated constructor stub

}

public static void main(String[] args) {

new Test();

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: