/*
* SuSheChaRu.java
*
* Created on __DATE__, __TIME__
*/
package manage;
import java.sql.ResultSet;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import com.sun.org.apache.xpath.internal.operations.And;
/**
*
* @author __USER__
*/
public class SuSheChaRu extends javax.swing.JFrame {
/** Creates new form SuSheChaRu */
public SuSheChaRu() {
initComponents();
}
public DefaultTableModel m;
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
//GEN-BEGIN:initComponents
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
jTextField5 = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jTextField7 = new javax.swing.JTextField();
jLabel8 = new javax.swing.JLabel();
jTextField8 = new javax.swing.JTextField();
jLabel9 = new javax.swing.JLabel();
jTextField9 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jComboBox1 = new javax.swing.JComboBox();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("\u5b66\u53f7\uff1a");
jLabel2.setText("\u59d3\u540d\uff1a");
jLabel3.setText("\u5bbf\u820d\u7f16\u53f7\uff1a");
jLabel4.setText("\u5bbf\u820d\u4eba\u6570\uff1a");
jLabel5.setText("\u5bbf\u820d\u7ed3\u6784\uff1a");
jLabel6.setText("\u5165\u4f4f\u65f6\u95f4\uff1a");
jLabel7.setText("username:");
jLabel8.setText("id:");
jLabel9.setText("\u5176\u4ed6\uff1a");
jButton1.setText("\u63d2\u5165");
jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton1MouseClicked(evt);
}
});
jButton2.setText("\u4fee\u6539");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("\u8fd4\u56de\u83dc\u5355");
jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
jButton3MouseClicked(evt);
}
});
jTable1
.setModel(new javax.swing.table.DefaultTableModel(
new Object[][] {
{ null, null, null, null, null, null, null,
null, null },
{ null, null, null, null, null, null, null,
null, null },
{ null, null, null, null, null, null, null,
null, null },
{ null, null, null, null, null, null, null,
null, null } }, new String[] { "学号",
"姓名", "宿舍编号", "宿舍人数", "宿舍结构", "入住时间",
"username", "id", "其他" }) {
Class[] types = new Class[] { java.lang.String.class,
java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.String.class };
public Class getColumnClass(int columnIndex) {
return types[columnIndex];
}
});
String[] col = { "学号","姓名", "宿舍编号", "宿舍人数", "宿舍结构", "入住时间",
"username", "id", "其他"};//创建属性列名
m= new DefaultTableModel(col,0);
jTable1.setModel(m);
jScrollPane1.setViewportView(jTable1);
jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
"2007年9月", "2008年9月", "2009年9月", "2010年9月", "2011年9月",
"2012年9月" }));
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
getContentPane());
getContentPane().setLayout(layout);
layout
.setHorizontalGroup(layout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(
layout
.createSequentialGroup()
.addContainerGap()
.addGroup(
layout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(
jScrollPane1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
634,
Short.MAX_VALUE)
.addGroup(
layout
.createSequentialGroup()
.addGroup(
layout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(
javax.swing.GroupLayout.Alignment.LEADING,
layout
.createSequentialGroup()
.addComponent(
jLabel1)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED,
17,
Short.MAX_VALUE)
.addComponent(
jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
56,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(
javax.swing.GroupLayout.Alignment.LEADING,
layout
.createSequentialGroup()
.addGroup(
layout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(
jLabel4)
.addComponent(
jLabel7))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(
layout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING,
false)
.addComponent(
jTextField7)
.addComponent(
jTextField4,
javax.swing.GroupLayout.DEFAULT_SIZE,
44,
Short.MAX_VALUE))
.addPreferredGap(
javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
.addGroup(
layout
.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING,
false)
.addGroup(
layout
.createSequentialGroup()
.addGap(
19,
19,
19)
.addGr