Resizing JME Window

Hey guys, everytime I connect to an projector my jme window becomes messed up and then I have to change the resolution of the screen and adjust it properly. I am trying to be able to resize the JME window on the fly. I have seen other posts suggesting using: TestRecreateWindow. to do so however that code is old and deprecated.

Anyone could point me to what are the steps I need to use or a working example of a resizable JME window?

I ve also read : and not sure if that’s one way to go as I couldn’t get the example to run.


these are the settings I am currently using:

[java] // initialize internal settings
AppSettings defaultSetting = new AppSettings(true);

    // set window title
    defaultSetting.setTitle("TESTING WINDOW");

    // set window height and width

    // Vsynch - Set vertical synching to true to time the frame buffer
    // to coincide with the refresh frequency of the screen.
    // VSync prevents ugly page tearing artifacts, but is a bit slower.

    // take off settings after putting them into effect


Try to change the settings and call app.restart() where app is the SimpleApplication to update the context.

Not sure we’re on the same page or I quite understood u. I am trying to be able to select the sides of the JME window and resize just like it’s possible to do with any JFrame window

@jonesadev I did what you said and created a temporary method that is called toggleToProjector() where I pass new settings and restart - THANKS! but this is more of a hack. I am looking for a real solution which allows me to resize the JME window on the fly

You can also create a canvas and display it in a JFrame.

I made a test case for you :

[java]public class Main extends SimpleApplication

public static void main(String[] args)
    Main app = new Main();
    Frame _frame = new JFrame();
    AppSettings settings = new AppSettings(true);
    _frame.setPreferredSize(new Dimension(settings.getWidth(), settings.getHeight()));
    JmeCanvasContext _canvasCtx = (JmeCanvasContext) app.getContext();
    Canvas _canvas = _canvasCtx.getCanvas();
    _canvas.setPreferredSize(new Dimension(settings.getWidth(), settings.getHeight()));


public void simpleInitApp()

public void simpleUpdate(float tpf)

public void simpleRender(RenderManager rm)


1 Like