Problem with StandardGame and GBUI

Im trying to make a menu screen using a StandardGame and BUI for the menu state:

public class Main {
   public static void main(String[] args) throws Exception {
      // Instantiate StandardGame
      StandardGame game = new StandardGame("Eternal Dream", StandardGame.GameType.GRAPHICAL, null);

      // Show settings screen
      //if (GameSettingsPanel.prompt(game.getSettings())) {
      // Start StandardGame, it will block until it has initialized successfully, then return
      // Create a DebugGameState - has all the built-in features that SimpleGame provides
      // NOTE: for a distributable game implementation you'll want to use something like
      // BasicGameState instead and provide control features yourself.
      //BasicGameState global = new BasicGameState("global");
      DebugGameState global = new DebugGameState();
      // Add it to the manager
      // Activate the game state
      GameState menu = new MenuGameState("menu");

public class MenuGameState extends BasicGameState {
   /** The cursor node which holds the mouse gotten from input. */
   private Node cursor;
   /** Our display system. */
   private DisplaySystem display;

    private Text text;

    private InputHandler input;
    private Mouse mouse;

    public MenuGameState(String name) {

        display = DisplaySystem.getDisplaySystem();
        BuiSystem.init(new PolledRootNode(Timer.getTimer(), input), "/rsrc/style2.bss");

        rootNode.updateGeometricState(0, true);

   private void createWindows() {
      // TODO Auto-generated method stub
      // add our login window to our BRootNode
      MainMenu loginMenu = new MainMenu("menu");


but then, i got this error:

Exception in thread "main" java.lang.ExceptionInInitializerError
   at com.jmex.bui.BStyleSheet$DefaultResourceProvider.loadImage(
   at com.jmex.bui.BStyleSheet$BackgroundProperty.resolve(
   at com.jmex.bui.BStyleSheet.getProperty(
   at com.jmex.bui.BStyleSheet.findProperty(
   at com.jmex.bui.BStyleSheet.getBackground(
   at com.jmex.bui.BComponent.configureStyle(
   at com.jmex.bui.BTextComponent.configureStyle(
   at com.jmex.bui.BButton.configureStyle(
   at com.jmex.bui.BComponent.wasAdded(
   at com.jmex.bui.BLabel.wasAdded(
   at com.jmex.bui.BContainer$2.apply(
   at com.jmex.bui.BContainer.applyOperation(
   at com.jmex.bui.BContainer.wasAdded(
   at com.jmex.bui.BContainer$2.apply(
   at com.jmex.bui.BContainer.applyOperation(
   at com.jmex.bui.BContainer.wasAdded(
   at com.jmex.bui.BWindow.setRootNode(
   at com.jmex.bui.BRootNode.addWindow(
   at com.jmex.bui.BRootNode.addWindow(
   at com.jmex.bui.BuiSystem.addWindow(
   at apalah.state.MenuGameState.createWindows(
   at apalah.state.MenuGameState.<init>(
   at Main.main(
Caused by: java.lang.NullPointerException
   at com.jmex.bui.BImage.<clinit>(
   ... 23 more

seems like BUI got an error when trying to add a window, but this error didnt occur when i used a BaseGame as a superclass,
could someone please help me? :(

What is null at com.jmex.bui.BImage.<clinit>(

its at this line:

_supportsNonPowerOfTwo = GLContext.getCapabilities().GL_ARB_texture_non_power_of_two;

but i've found what caused it, its because i was trying to add a BUI Window before the game loop started, i should have done it like this:

GameTaskQueueManager.getManager().update(new Callable() {

    public Object call() {


        return null;



what i guess is, the createWindows() method has to wait to be called after some thing happened or in the game update, i  wasnt quite understand this kind of concept before though… i should have read your tutorial carefully about "StandardGame, GameStates, and Multithreading" darkfrog :smiley:

hehe…good to know my ramblings come to some benefit sometimes. :slight_smile: