private void inittable() { // setup the jtable String[] kolommen = {"Voornaam", "Achternaam", "Tafel_Nummer"}; model = new DefaultTableModel(kolommen, 0); Table_Opstelling.setModel(model); }
/** * 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. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); Table_Opstelling = new javax.swing.JTable(); Button_Save = new javax.swing.JButton(); Button_Back = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); Table_Opstelling.setModel( new javax.swing.table.DefaultTableModel( new Object[][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String[] {"Title 1", "Title 2", "Title 3", "Title 4"})); jScrollPane1.setViewportView(Table_Opstelling); Button_Save.setText("Save"); Button_Save.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Button_SaveActionPerformed(evt); } }); Button_Back.setText("Back"); Button_Back.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Button_BackActionPerformed(evt); } }); org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( layout .createSequentialGroup() .addContainerGap() .add( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE) .add( layout .createSequentialGroup() .add( Button_Back, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 84, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap( org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add( Button_Save, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 102, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) .addContainerGap())); layout.setVerticalGroup( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( layout .createSequentialGroup() .addContainerGap() .add( jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 253, Short.MAX_VALUE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) .add(Button_Save) .add(Button_Back)) .addContainerGap())); pack(); } // </editor-fold>//GEN-END:initComponents