Thanks Marks for your earlier reply.
I am approaching my GUI as per following,
1.I designed one single Panel with gridbaglayout, components like JComboBoxes, JLables and Buttons for "Search" and "Clear" are added.
2. Method getFlight() fills the Origin and Destination JComboBoxes from Database.
3. I first tried to display all above stuff. I still have not handled event handling upto this point.
I created a JTable by using MVC pattern.
Model - MainTable , which holds data of Databse and has getter and setter methods for columnNames and rows(rows of DataInfo)
Controller - Uses Setter method of mainTable. This class has criteriaFind("Origin airport='SFO'") method.(This criteria is not from JCoboBoxes, it is a fake criteria , just to test whether my JTable is created with this criteria.) The result of criteriaFind is used to set the values in MainTable.
FbnTableModel- This class extends AbstractTableModel and implements getRowCount(), getColumnCount,getValueAT() method. These methods basically use getter methods from MainTable.
Finally View - extends JTable and dispalys the Jtable.
My Part 1 and Part2 are not still linked. Means whatever criteria I selected in part 1 is not passed to Part 2 to display JTable. I just divided GUI in two parts so that I can write, test the code separately. Now I am sure for functinality of both.
Now I am going to combine the two parts. I have formed the String criteria from Comboboxes. And I am working to pass this String criteria, from part 1 to Part 2, to dispaly the JTable.
Hope it helps