Lmur gui how to set position set size set window size?

Hello i learn lemur gui
GitHub - jMonkeyEngine-Contributions/Lemur: Lemur is a jMonkeyEngine-based UI toolkit.

    / Initialize the globals access so that the defualt
    // components can find what they need.
    // Load the 'glass' style
    // Set 'glass' as the default style when not specified

    // Create a simple container for our elements
    Container myWindow = new Container();
    // Put it somewhere that we will see it
    // Note: Lemur GUI elements grow down from the upper left corner.
    myWindow.setLocalTranslation(320, 320, 10);

    // Add some elements
    myWindow.addChild(new Label("Hello, World."));
    Button clickMe = myWindow.addChild(new Button("Click Me"));
    Button clickMe2 = new Button("");
    clickMe2.setSize(new Vector3f(0.5f, 0.5f, 0.5f));
    clickMe.addClickCommands(new Command<Button>() {
            public void execute( Button source ) {
                System.out.println("The world is yours.");

How to resize window? setLocalTranslation not working
How to set button size? setSize(new Vector3f(5, 5, 5)); not working
How to set button position on windows? i need squeare 3x3


You cas use setPreferedSize().

The position is handled by the layout. By default Container uses SpringGridLayout which uses a grid. You can set the position of the child when adding it to the container.

1 Like

Also, note that you are trying to set you button to be half a pixel wide.

1 Like