netbeans中的小知识

来源:互联网 发布:it桔子网 编辑:程序博客网 时间:2024/05/21 11:24

//界面居中      

  this.setLocationRelativeTo(null);

//小弹窗

 JOptionPane.showMessageDialog(this,"非常感谢您的评价")

//打开新的界面,关闭当前界面

       new  Student().setVisible(true);
        this.dispose();

//从数据库查询数据显示到jtable内

        DefaultTableModel tm = ( DefaultTableModel) jTable1.getModel();//自动调整jtable行数
        String[][] strA=null;//创建数组
        try {
            strA = Dao.pingInf();//调用方法,获取查询的信息,存储到数组上
        } catch (SQLException ex) {
            Logger.getLogger(adminselect.class.getName()).log(Level.SEVERE, null, ex);
        }
        for ( int row = 0;row <strA.length;row++){
              tm.addRow(strA[row]);//将信息显示到table里
        }

0 0
原创粉丝点击