Problem with 3D and swing
-
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import processing.core.PApplet;
public class kjfg {
private JFrame frame;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
kjfg window = new kjfg();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public kjfg() {
initialize();
}
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 643, 575);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(null);
JPanel panel = new JPanel();
panel.setBounds(6, 6, 631, 541);
PApplet sk = new app();
panel.add(sk);
sk.init();
frame.getContentPane().add(panel);
}
}
class app extends PApplet {
public void setup() {
size(500, 500, OPENGL);
noLoop();
}
public void draw() {
background(51);
}
}