ewaldhorn's Avatar, Join Date: Feb 2010
Go4Expert Member
Hi.

OK, I see you are a bit stuck.

I'll have to wait until I get home before I can write up some code for you.

Best regards,
Ewald
rajasohaibmaroof's Avatar, Join Date: Sep 2011
Go4Expert Member
thank u brother ! help me . i have been doing this jtable assignment form last one month n i want to get it done now ! desperately w8ng for ur post
rajasohaibmaroof's Avatar, Join Date: Sep 2011
Go4Expert Member
hi i m able to delete a selected row by using this code
Code:
private void selectedCol(JTable table){
    int row = table.getSelectedRow();
int col = table.getSelectedColumn();

Object value = (String)table.getValueAt(row, col);
System.out.println(row+""+col);
System.out.println("Value =: "+value);

if (col==2){
    defaultTableModel.removeRow(jTable1.getSelectedRow());
}
}
Code:
 private void jTable1MouseClicked(java.awt.event.MouseEvent evt) {                                     
        // TODO add your handling code here:
        selectedCol(jTable1);
    }
but if a make col==3 then it wont work .that means m unable to make col 3 buttons clickable how should i do thats? thnx in advance
ewaldhorn's Avatar, Join Date: Feb 2010
Go4Expert Member
Hi.

I found a much better example on the internet at :

http://www.cordinc.com/blog/2010/01/...-a-jtable.html

The explanation and code is superior to mine, I humbly suggest you visit the website and read what the author wrote.

Best regards,
Ewald
rajasohaibmaroof's Avatar, Join Date: Sep 2011
Go4Expert Member
any one pleaseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ee help me i m stuck here ): ( i am unable to click button in jtable