use of com.jme3.system.awt.AwtPanelsContext in project jmonkeyengine by jMonkeyEngine.
the class TestAwtPanels method main.
public static void main(String[] args) {
Logger.getLogger("com.jme3").setLevel(Level.WARNING);
app = new TestAwtPanels();
app.setShowSettings(false);
AppSettings settings = new AppSettings(true);
settings.setCustomRenderer(AwtPanelsContext.class);
settings.setFrameRate(60);
app.setSettings(settings);
app.start();
SwingUtilities.invokeLater(new Runnable() {
public void run() {
/*
* Sleep 2 seconds to ensure there's no race condition.
* The sleep is not required for correctness.
*/
try {
Thread.sleep(2000);
} catch (InterruptedException exception) {
return;
}
final AwtPanelsContext ctx = (AwtPanelsContext) app.getContext();
panel = ctx.createPanel(PaintMode.Accelerated);
panel.setPreferredSize(new Dimension(400, 300));
ctx.setInputSource(panel);
panel2 = ctx.createPanel(PaintMode.Accelerated);
panel2.setPreferredSize(new Dimension(400, 300));
createWindowForPanel(panel, 300);
createWindowForPanel(panel2, 700);
/*
* Both panels are ready.
*/
panelsAreReady.countDown();
}
});
}
Aggregations