Implementing methods from other classes
<p>I am not able to understand why is it not working?</p>

<p>I've got my methods class:</p>

<pre><code>package particles;

import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;

public class Methods {
Graphics g;

public void showhud(){
    g.setColor(Color.white);
    g.drawString("Screen: Game", 675, 10);
    g.drawString("Version: 1.0", 675, 25);
    }

}
</code></pre>

<p>But when i try to implement showhud() in my other class, it doesn't work!</p>

<p>This is how im using it:</p>

<pre><code>package particles;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.BasicGameState;
import org.newdawn.slick.state.StateBasedGame;
import particles.Methods;

public class Game extends BasicGameState {
Methods m;

public void init(GameContainer container, StateBasedGame game) throws SlickException {

}

public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
    m.showhud();
}

public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {

}

public int getID() {
    return 0;
}

}
</code></pre>

<p>The error i get is:</p>

<pre><code>Tue Jan 01 17:19:36 NZDT 2013 ERROR:null
java.lang.NullPointerException
at particles.Game.render(Game.java:18)
at org.newdawn.slick.state.StateBasedGame.render(StateBasedGame.java:207)
at org.newdawn.slick.GameContainer.updateAndRender(GameContainer.java:703)
at org.newdawn.slick.AppGameContainer.gameLoop(AppGameContainer.java:456)
at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:361)
at particles.Main.main(Main.java:23)
</code></pre>
