Home Segments Top Top Previous Next

921: Mainline

Having defined the RatingPanel constructor, you now proceed to the setters and getters required by the RatingPanelInterface interface.

The getters are straightforward; each returns a value:

public int getValue1() {return value1;} 

Elementary setters also are straightforward; each assigns an instance variable and updates a text field:

public void setValue1(int v) { 
 value1 = v; 
 field1.setText(String.valueOf(value1)); 
}