aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Model for the JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Model for the JTable" Watch "Model for the JTable" New topic

Model for the JTable

Amit Kr Kumar
Ranch Hand

Joined: Feb 08, 2002
Posts: 100
Hi Mark
Who should set the TableModel for JTable using table.setModel(new MyTableModel())
1) The View itself
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[])

Is this correct ???
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

I had the Controller handle it.

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
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.

Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

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.
I agree. Here's the link:
subject: Model for the JTable
Similar Threads
JTable Question
Add a new row to JTable
Getting data from JTable