I have made a class called Clients, that it has like some simple attributes like client_id, client_name and client_age. I have programmed a small GUI with NetBeans that after I input the data from a client by pressing a button I get it displayed in a jTable.
The source code for adding this in the jTable is:
for (int i=0;i<customerV.length;i++){ jTable2.setValueAt(customerV[i].getName(), i, 0); } I would like that if I click one element on the jTable to be able to add some orders to that client by making using of a jButton. If I program that in a console it would be like:
Order order1=new Order("1000","41211") in which the first field is the order id and the second is the order number, so if I want to assign that to Customer 1 it would be like.
c1.assignOrder(order1) how I can do that by using java swing? I mean to select the whole object from the element that I click in the jTable