Ok I am trying to make an applet, but I am not using the built in applet maker. Instead I am compiling the file, and uploading the jar to my website, with an HTML file of my own. I had previously made part of the applet, and the HTML file, and I know they work fine. My problem comes on the implementation of the JME file. I have a file that extends JPanel, and I am trying to add the JME file to it. When I click the JButton that loads this section of the script (which I have set to removeAll() then adds this) the whole screen goes blank and nothing seems to load.
[java]
AppSettings settings = new AppSettings(true);
settings.setWidth(640);
settings.setHeight(480);
JMEPanel = new YoonairJMEPanel();
JMEPanel.setSettings(settings);
JMEPanel.createCanvas();
JmeCanvasContext ctx = (JmeCanvasContext) JMEPanel.getContext();
ctx.setSystemListener(JMEPanel);
Dimension dim = new Dimension(640, 480);
ctx.getCanvas().setPreferredSize(dim);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(ErrorsLabel)
.addComponent(ctx.getCanvas())
);
layout.setVerticalGroup(
layout.createSequentialGroup()
.addComponent(ErrorsLabel)
.addComponent(ctx.getCanvas())
);
JMEPanel.startCanvas();[/java]
I have been trying to follow the tutorial, but I can’t seem to get the answer.