hello, i have two JButton to do same work over two  jtable , how i can do the 
some accion with one Jbotton only ?how i pass the jtable name or model to the 
FOR loop ?? for  reuse the code
see the code..
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {          
                                       // TODO add your handling code here:
         DefaultTableModel model =  (DefaultTableModel) jTable1.getModel();     
    DefaultTableModel m =   (DefaultTableModel) jTable2.getModel();        
          int n=jTable1.getRowCount()-1;
         int i;            try {         for (  i=n;i>=0;i-- ){
             model.removeRow(i);
         }         }catch (Exception dx){ }
         

    }     


thanks.                                                                         
  
                                          
_________________________________________________________________

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to