Hi, rachers: 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.
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? Thanks.
hi christy, 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
Joined: Feb 18, 2002
Christy: I think the idea about blank table or your idea are both ok. Guys: 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? Thanks.
Joined: Oct 15, 2001
Hi, Dean, 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. http://www.coderanch.com/t/181321/java-developer-SCJD/certification/initial-dispaly-table Thanks
Joined: Feb 25, 2002
All you have to do is create only one instance of a JTable and only one instance of a TableModel. Table model can be either DefaultTableModel instance or you can extend AbstractTableModel and create your own model. In your table model, you provide methods to populate the two dimesional array or some collection in it.