Mapping Model to View

Step 1

In the Model, provide a "SelectorString" for the screen component:

        
public class HelloModel {     
    private String name; // this is the selectorstring for a name STextfield     
    public void setName(String inName) {         
        name = inName;     
    }     
    public String getName() {         
        return name;     
    } 
}

Step 2

In the View, associate the model selectorstring with the Swing component:

        
STextField t = new STextField();         
t.setColumns(20);         
//associate this component with a variable called name in the model 
t.setSelectorString("name");          
add(t, BorderLayout.EAST);