title: Slick2D GUI Button listener
body: <p>I'm trying to make button in slick by extending AbstractComponent:</p>
  
  <p>public class StandardButton extends AbstractComponent {</p>
  
  <pre><code>protected int x;
  protected int y;
  protected int Width;
  protected int Height;
  protected String Text;
  
  public StandardButton(GUIContext container,int x, int y, String Text, int Width, int Height,ComponentListener listener) {
      super(container);
      this.Text=Text;
      setLocation(x, y);
      this.Width=Width;
      this.Height=Height;
      addListener(listener);
  
  
  
  }
  
  @Override 
  public void render(GUIContext container, Graphics g) throws SlickException {
      g.setColor(Color.white);
      g.setLineWidth(2f);
      g.drawRect(x, y, Width, Height);
      g.drawString(Text, x+5, y+(Height/2-4));
  
  }
   [...]
  </code></pre>
  
  <p>And in my state:</p>
  
  <p>public class UpdaterState extends BasicGameState implements ComponentListener {
       private StandardButton buttonPlay;</p>
  
  <pre><code>@Override
  public void init(GameContainer container, final StateBasedGame game)
          throws SlickException {
          buttonPlay=new StandardButton(container,100,100,"Graj",60,30,new ComponentListener(){
  
              @Override
              public void componentActivated(AbstractComponent source) {
                  State.nextState(0, game);
  
              }
  
          });
  </code></pre>
  
  <p>But nothing happens. My nestState method does not run when i click my button. How schould I do that correctly? I just want my program to do block in componentActivated method. Is that possible or i just need to chceck if mouse is released on my button field in update method all the time for all buttons?</p>