I have a TableModel to store the search results. My question is: how do we set up the initial display of the table? put entire database in table model and display it, then refresh the table based on search results? or display an empty table first?---if I set cells to null, I get nullpinterexception. Any suggestion is appreciated.
I could display an empty table now. I still have trouble refresh the table. This is what I do not understand: if I display an empty table first like this:
Since the table is already added, once I get the search results, I have to do this again? :
I am confused here, the above code certainly will not work, should I use a TableModelListener to refresh table? Thanks.
i personally think it is better to have just one button to execute the retrieval of the flights, based on the selections in your comboboxes / textfields.
i've got another button titled "reset" that sets my combo boxes to Any, so the user can easily retrieve all flights using 2 button clicks.
good luck with the assignment. dean
I think the idea about blank table or your idea
are both ok.
I still cannot show the table for search results
after I set up an initial empty table. Should I define this blank table in my table model class then new a table model with null table values? Or define it in GUI without using table model first?
The latter seems not work. Any advice? Thanks.
Originally posted by christy smile:
Hi, I have a similar doubt in mind while designing the GUI. Then, I decided that I will display an empty table when the client first comes up. I supplied a button in the GUI called "ShowAll" that displays everything in db.db in the JTable. Anyone think this is a good idea?
I have a "reset" button as well, which clears the origination and destination fields and display the whole database in JTable. Now, it seems "ShowAll" button is a bit redundant. With your reset button, do you field the fields with "any" or leave them blank? Mine leave the fields blank. I started a different thread about handling the blank textfield for criteriaFind, please take a look and give me your thoughts about it.