Hi Guys,
I am quite experienced in programming with Java. I have though come accross a small problem, I don't know how to implement the MVC pattern. I understand the concepts of the MVC pattern and I was hoping that someone on this forum could help.
I have a model which is just a class that adds 2 integers together and returns the answer. The code is shown below.
public class Adder
{
public int add(int x, int y)
{
return x + y;
}
}
Now what I want to do is apply the MVC pattern to the above model. I want to have a Swing interface with 2 textboxes and an equals button which then displays the answer. How do I apply the MVC pattern?
Please don't try and mix the view and contoller in one - keep it separate.
Thanks