import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

/**
 *
 * @author AlexeyW
 */
public class Button {
    
    private boolean state;
    
    public void setState(boolean flag) {
        state = flag;
    }
    
    public boolean getState() {
        return state;
    }
    
    public void paint(Graphics g, int x, int y, Image[] button) {
        g.drawImage(state ? button[1] : button[0], x, y, 20);
    }
    
}