if (!LwjglInitHelper.initSubSystems("Nifty Controls Demonstation")) {
System.exit(0);
}
// create Nifty and load default styles and controls
Nifty nifty = new Nifty(new LwjglRenderDevice(), new OpenALSoundDevice(), LwjglInitHelper.getInputSystem(), new TimeProvider());
nifty.loadStyleFile("nifty-default-styles.xml");
nifty.loadControlFile("nifty-default-controls.xml");
nifty.registerSound("intro", "sound/19546__tobi123__Gong_mf2.wav");
nifty.registerMusic("credits", "sound/Loveshadow_-_Almost_Given_Up.ogg");
nifty.registerMouseCursor("hand", "mouse-cursor-hand.png", 5, 4);
registerMenuButtonHintStyle(nifty);
registerStyles(nifty);
registerConsolePopup(nifty);
registerCreditsPopup(nifty);
// register some helper controls
MenuButtonControlDefinition.register(nifty);
DialogPanelControlDefinition.register(nifty);
// register the dialog controls
ListBoxDialogControlDefinition.register(nifty);
DropDownDialogControlDefinition.register(nifty);
ScrollPanelDialogControlDefinition.register(nifty);
ChatControlDialogDefinition.register(nifty);
TextFieldDialogControlDefinition.register(nifty);
SliderAndScrollbarDialogControlDefinition.register(nifty);
DragAndDropDialogDefinition.register(nifty);
createIntroScreen(nifty);
createDemoScreen(nifty);
nifty.gotoScreen("start");
// start the render loop
LwjglInitHelper.renderLoop(nifty, null);
LwjglInitHelper.destroy();
}