So in the JTable, column 0 contains a "custom row number" and the other two columns contain two fields from the database row? It seems to me that given that requirement it shouldn't be too difficult to write the code.
It looks to me like your code which declares the table model to have three columns is mostly okay. But your code which sets up a table row from a database row needs to be fixed to include the custom row number.
Here you have some code which puts the columns from the ResultSet into that Vector.
But you want the first entry of the Vector to have a custom row number, and then the subsequent entries to have the column from the ResultSet. So:
That really wasn't that difficult, was it?
posted 1 month ago
Great. I am Thankful to you.
Sir now i want a best advise from you on the following matter. My application have 5 categories combo boxes are populate from the database.
Now i am reaching to make a final data entry form. I have two options
1. Use Combo and text boxes on the panel and save the record to the database. By this user insert record to database one by one. If operator needs any category which is not available in respective combo it opens related form and add new category and then back to data entry form and refresh the combo and starts to enter data.
2. But i have an idea if i make a JTable and add combo boxes in it. Column A,B,C,D,E. Suppose at Row 30 the user need to add an category at Column B Combo , It opens the related category form add it. Now he return to the JTable at row 30 how he refresh the only combo at row 30 while the above 29 values already found ok.
If i refresh the combo with an GUI button then all the combos above line 30 also refresh and selected items are changed.Is there any way to just refresh the specific row combo with update data.
Whats you suggest for me?
I am waiting for your value able suggestion.
And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book