Please give me an example for MVC pattern used in Java SWING package ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Basically, a Swing component is itself a controller, which has a reference to a view and a model.
The view is in the
JComponent.uifield that is inherited by all swing components and used by the Look&Feel mechanism to provide different visual representations of Swing components.There are different
setModel()methods in various subclasses that use different model types such asTableModelorButtonModel, which can be implemented by an application programmer to contain the actual data that the Swing UI displays and manipulates.