Forums Register Login

Model for the JTable

+Pie Number of slices to send: Send
Hi Mark
Who should set the TableModel for JTable using table.setModel(new MyTableModel())
1) The View itself
or
2) The GUI controller
What i believe is that the View should not be worried abt the model.
How did u handled this ???
As far as origin and destination airports are concerned, the mode selection form controller pass it to the Booking Form constructor as:
obj = new BookingForm(DataInfo[] roigin, DatraInfo destination[])
obj.show()

Is this correct ???
Amit
+Pie Number of slices to send: Send
I had the Controller handle it.
Mark
+Pie Number of slices to send: Send
If I were to implement the MVC PATTERN for the FBN application then I should have three components i.e FBNModel, FBNView and FBNController. I know that FBNModel encapulates data, FBNView would basically be the Frame containing the JTable and FBNController would basically be used for taking care of user actions on the front-end and transfer them to FBNModel for fetching new set of data and use this data to refresh the FBNView. Please correct me if I am wrong in interpreting the MVC pattern.
+Pie Number of slices to send: Send
Yuo are basically correct. But the Model does not know about the View, so it is still the Controller that handles it all for you.
Mark
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 714 times.
Similar Threads
Getting data from JTable
jtable
JTable Question
Jtable
Add a new row to JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 16:34:55.