lundi 16 octobre 2017

How do I display an auto-generating checkbox column along with the existing database in a JTable that updates the selected row's data?

(Not sure if I framed the question right, so let my description do the justice.)


  • My Jtable displays existing database data.
  • I want to add another attribute to every tuple, such that it updates a part of the data, of only those rows which have been selected by the user using the checkbox.
  • checkbox field isn't a part of the database table. (Let me know if it is possible to add it)
  • Also, every time a new entry is added to the database, when being displayed on the Jtable, it should come with an auto-generated row-updating checkbox.)

(I specify the above constraint so that the solution should work for not only existing data, but also for any data that will be added afterwards.)

For Example: if a new student has been added to the database, while displaying his data on Jtable, it should also come with the checkbox attribute.(because checkbox isn't a part of database table and the back-end programmer won't assign values to it; The front end user will.)


I've tried generating a column for checkboxes by selecting the column type as boolean, using the JTable options provided by Eclipse IDE. It looked like that'd work, but it didn't, really. It created a not-so-interesting checkbox that does nothing significant.

I am not asking for you to design the solution for me. I just want you to tell me how to do it. Assuming you've understood what my problem is, can you help me out?

  1. My Database: Oracle 11g Express Edition
  2. Front End: Java Swings(JFrame)
  3. IDE: Eclipse Oxygen EE



Aucun commentaire:

Enregistrer un commentaire