TOC PREV NEXT INDEX

Counter.java


Our first task is to create the backing beans that will be used to hold the state of the counters. First we'll start with a generic counter that we can use as the base class for our more specialized counter implementations.

Create a new class called Counter by typing or copying the following into your editor:

package org.icefaces.tutorial.easyajaxpush;
 

 
import javax.faces.event.ActionEvent;
 

 
public class Counter {
 

 
private int count;
 

 
public Counter() {
 
    }
 
public int getCount() {
 
        return count;
 
    }
 
public void setCount(int count) {
 
        this.count = count;
 
    }
 

 
    public void increment(ActionEvent event) {
 
        count++;
 
    }
 

 
    public void decrement(ActionEvent event) {
 
        count--;
 
    }
 

 
}
 


Copyright 2005-2009. ICEsoft Technologies, Inc.
TOC PREV NEXT INDEX