• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTable & Edit Button Click

 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All

I am using JTable. I need suggestion regarding following. Please help me out.

I need suggesgtion that at background what should i use to know that a particular row is added,edit,delete or a certain operation is done.

All the following operation are done after clicking Edit Button.

1. I have add button to add row into jTable.

2. I have edit button to edit a particular row. And there is another column that shows that if "YES" is selected then only "YES" option value are updated. Is this correct.....???

3. I have delete button to remove a particular row. How do i know if 3 rows are deleted randomly out of 10 rows. (Shoud i use vector or something else)

4. What if Row # 3 is deleted and another Row is added at last. How do i know that which row is added as total rows are 10 in both cases (delete/add row).

5. How do i know that particular row is edited. Let column 1 has code = 1001 and that column value is now change to 1002. (I think i can get this from YES option as i defined in Q#2.) Is this correct.

Please help me what technique should i use to handle my all required events.
Answer me if you can help me out regarding any of above scneario.

Thanks in advance.
 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I did not try this before, but I think you can use TableModelListener interface. It has only one method tableChanged(TableModelEvent e)
and I think every time your table changed this method would be called and executed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic