SHARE
TWEET

Tabela Aluno

a guest Jul 31st, 2013 25 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void atualizar(){
  2.           try {
  3.             tbAluno.setModel(new javax.swing.table.DefaultTableModel(
  4.              new Object [][]{} , new String []{"N° de Escrição","Nome"}){});  
  5.               DefaultTableModel tabela = (DefaultTableModel) tbAluno.getModel();
  6.               while (aluno.consulta.next()){
  7.                int codigo = aluno.consulta.getInt("idAluno");
  8.                String nome = aluno.consulta.getString("nome");
  9.                
  10.                 tabela.addRow(new Object[]{codigo,nome});//adicionar linhas a tabela
  11.               }
  12.         } catch (Exception on) {
  13.             JOptionPane.showMessageDialog(rootPane, "Não foi possível montar a tabela");
  14.         }
  15.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top