hi everyone Initially the display on the JTable should have 1 row and 2 columns If the user presses Enter Key on the 2nd column of the first Row then a Row should be added. Now the RowCount should be 2. If the user presses the enter key on the 2nd column of the 2nd Row then a row should be added resulting in RowCount 3. ie On pressing Enter key in 2nd column of JTable a new Row should be added to the existing Table give a solution to the above query ur help is appreciated email@example.com
You will have to add a listener for the enter button (ActionListener) and in the actionPerformed method you will have to get a handle on the data model, add a row to that model and then fire a table updated event on the table. That should do it.
Joined: Jun 18, 2002
hi thanks for ur reply on for my posting of dynamic increase of rows u made a reply that add a listener i have added key listener and then proceeding on i dont know how to use data model and firing events could u help me out with some code for this i have been frustrated by this problem for a week need ur help