File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Model for the JTable" Watch "Model for the JTable" New topic
Author

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
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
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

I had the Controller handle it.
Mark


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.


SCJP, SCJD, SCWCD, SCBCD, SCEA
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Model for the JTable