Step 1. Start Net Beans
Step 2. Click new Project and choose the Project type
Step 3. Type in the Project name ensure that "create main class" is checked and "set as main project" is checked
Step 4. We will leave the main method blank for now. Later we will add code here.
Step 5. We need a JFrame form. Right Click on Source Package and select a JFrame Form
Step 6. Choose a name for the form. In this case I have given "InputView" as the name.
Step 7. Time now to draw the form. Pain the controls. Use the controls from tools palette
Step 8. Net Beans has already done some work by adding the main method. But we will remove the method from this.
Step 9. Add the imports java.awt.event.*;
Step 10. Write a method and this method makes it known and somewhere else someone or some other object may be listening to it. Add an actionListener. This is an important step.
Step 11. Now it is time to draw another form. From the source package right click on the project name file once again and select JFrame Form.
Step 12. Give an appropriate name. In this case I have given it OutputView.
Step 13. Paint the form with necessary label control and set the Font, color etc.
Step 14. NetBeans has done some work but we need to remove it.
Step 15. Now we will write a setter for the label control.
Step 16. Right click on the source package. And this time choose add a new Java class. Give an appropriate name. In this case i have given ControllerForTwoForms
Step 17. We need to declare two private variables for both the views (forms) we have designed. There is a constructor that takes in the instances of both the views and tags them to the local private instance variable. At this point we need to make the controller aware to listen to an event that is going to occur in another object. To achieve this purpose we have to write an inner class that processes the request. It is here we are writing the code for the event that is happening elsewhere. Essentially we are bringing the text box message from one form to the other.
Step 18. Now time to write code in the main method. We need to declare instance variable both for OutputView and InputView. We also need to declare an instance variable for ControllerForTwoForms and pass the instance variables as an argument to the constructor. Thats it. Run the file.

















