3.1-alpha1 With the swing Canvas Are not compatible

hello everybody ,I use ChaseCamera ,The mouse to click the swing interface to operate.When I click on JME pictures occasionally unable to get focus, camera, move the mouse can’t hide

First thing to check out: are you in violation of the EDT rule?

I all the event function annotation, leaving only empty shell interface

Switch from swing focus to JME focus, need to click the mouse to enter many times focus on JME canvas.
Running on jMonkeyEngine 3.0.10 swing focus into the JME focus only need to click once

My game has a very complicated swing entity management system that uses AWTPanels everywhere … I am running 3.1-a3 and I have no problems focusing on a swing panel and back to a JME panel.

1 Like

Thank you, I have done this problem!But low FPS Between 10 to 20

Have you tried using the beta 3.1 release? I couldn’t get my user interface editor to work with alpha 1 or 2 but it works fine with 3.1 beta.

You do not want to use AWTPanel for more than just preview panels. The way I set up my game is you have a very complex and cool swing app for building, researching, and a ton of things you do outside of flying and blowing things up then under “command center” you have menu options to view in game sectors where the swing app launches a pure JME client for the actual in game stuff. Another problem with AWTPanel is that is does not work with post processing filters like bloom.

mhh?
EDIT:
http://i.imgur.com/ddJUoT5.png

Yes I posted about this a few times about a year ago. Bloom swaps out the frame buffer and blows up AWTPanel. AWTPanel will have to be re-written for it to work. Your picture shows a canvas NOT a panel :stuck_out_tongue:

The SDK works with the AWT panel

Edit : Unless I’m wrong @normen?

You are wrong I believe. My swing side of my game still blows up with bloom on AWTPanel and I am on 3.1-a3

Well… we have the AWTPanel… and the canvas…and it’s not using the canvas.

I can easily drop in 3 lines of code on my swing side of my game and report back. Give me a minute.

The sdk uses the AWTPanel unless you say otherwise in the settings, and I did not check the canvas checkbox.

So maybe it’s more an issue on your side?

Nope … it’s STILL broken. No issue on my side. This has been a known bug for at least 1.5 years.

java.lang.IllegalStateException: Why did you change the output framebuffer?
at com.jme3.system.awt.AwtPanel.postFrame(AwtPanel.java:328)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1045)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1088)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:260)
at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:194)
at com.jme3.system.awt.AwtPanelsContext.access$100(AwtPanelsContext.java:44)
at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:68)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:125)
at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:156)
at java.lang.Thread.run(Thread.java:745)

And the code …

panel = SystemFactory.getAwtPanelsContext().createPanel(PaintMode.Accelerated);
						panel.setPreferredSize(new Dimension(400, 300));
						

						camera = new Camera(SystemFactory.getJmeApplication().getCamera().getWidth(),
								SystemFactory.getJmeApplication().getCamera().getHeight());
						camera.copyFrom(SystemFactory.getJmeApplication().getCamera());
						camera.setFrustumPerspective(35, 400f / 300f, .1f, 5000f);
						flyCamera = new FlyByCamera(camera);
						flyCamera.setMoveSpeed(5);
						flyCamera.registerWithInput(SystemFactory.getJmeApplication().getInputManager());
						flyCamera.setDragToRotate(true);
						flyCamera.setEnabled(false);
						SystemFactory.getJmeApplication().getRootNode().attachChild(rootNode);
						viewPort = SystemFactory.getJmeApplication().getRenderManager()
								.createMainView("v" + ((BaseModel) getParent()).getGuidField().getValue(), camera);
						viewPort.setClearFlags(true, true, true);
						viewPort.attachScene(rootNode);

						FilterPostProcessor filterPostProcessor = new FilterPostProcessor(SystemFactory.getAssetManager());
						BloomFilter bloom = new BloomFilter(GlowMode.Objects);
						filterPostProcessor.addFilter(bloom);
						viewPort.addProcessor(filterPostProcessor);
						panel.attachTo(false, viewPort);

Well… how does it work in the SDK then? maybe there is a workaround this.

@normen did you make a wizard trick back then?

I would LOVE to know have @normen pulled this magic off as well!

I bet he ignored the option settings and just uses the canvas. That’s the ONLY way he could have pulled it off.

nha, you see the obvious difference when you turn the canvas on, everything is staring to fall appart.