Getting Started with jMonkey

Hello Everybody,

first off all, i’m glad to be a part of this Community. I was searching the internet for Java Engines and found this great stuff so i decided to try it. I was working the Tutorial and ok i think i understand it a little bit. My First try was to great a GameState and simply show a Nifty button, for just click to end the game, making simple and small steps :).

I’m working with c++ for 2 years now and i think i will give Java a chance and i like it, it is not to hard to learn. So my Question is now, how i have to start with the Engine ? I Just want to create a Gamestate and make this Button.

This is my first try, but i was not able to set up Niffty because i dont find the import path for the stuff i need to create an object off it.

[java]package mygame;

import mygame.GameState.Game_Load;


import com.jme3.system.AppSettings;

public class Main extends SimpleApplication {

static Main app;

public static void main(String[] args) {

app = new Main();

AppSettings settings = new AppSettings(true);








public void GameInit()



Game_Load gload = new Game_Load(this);




public void simpleInitApp() {



public void simpleUpdate()






And the GameState class:


  • To change this template, choose Tools | Templates
  • and open the template in the editor.


    package mygame.GameState;


    import com.jme3.font.BitmapText;

    import com.jme3.font.BitmapFont;

    import mygame.Main;

    public class Game_Load extends AbstractAppState{

    private Main m_Engine;

    BitmapFont guiFont;

    BitmapText helloText;

    float in = 0;

    public Game_Load (Main i_m_Engine)


    m_Engine = i_m_Engine;


    public void init()


    //BitmapText helloText = new BitmapText(m_Engine.getAssetManager().loadFont(“Interface/Fonts/Default.fnt”);

    guiFont = m_Engine.getAssetManager().loadFont(“Interface/Fonts/Default.fnt”);

    helloText = new BitmapText(guiFont, false);


    helloText.setText(“Hello World”);

    helloText.setLocalTranslation(300, helloText.getLineHeight(), 0);




    public void update(float tpf)





    ok the Engine start and the Game is up, Hello world is in the Text. And now ? how i’m able to create a gui ? How i’m able to switch the Gamestate ? I really need help. How i’m able to setup new KeyBinding ?

    i hope somebody could help me

I suggest going through the tutorials top to bottom to get accustomed to the jme basics like input etc:

Then theres more detailed info about AppStates and Controls further below.