Hello everybody.
I need to put a JME canvas into my app JPanel.
In the class with JME I init this:
public JmeCanvasContext ctx;
public Dimension dim = new Dimension(800, 600);
private void init() {
AppSettings settings = new AppSettings(true);
settings.setWidth(dim.width);
settings.setHeight(dim.height);
// settings.setRenderer(AppSettings.LWJGL_OPENGL1);
setSettings(settings);
createCanvas(); // create canvas!
ctx = (JmeCanvasContext) getContext();
ctx.setSystemListener(this);
ctx.getCanvas().setPreferredSize(dim);
startCanvas();
}
Then, in my main Window I create a JPanel (using NEtbeans designer tool) and add my jme canvas to the panel.
PanelDelAgente.add(agenteMolon.ctx.getCanvas());
But doesntwork. Is the first time that I use JME and I dont know very well how can I put it in a Jpanel
Thanks for your time!