We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
P3D on Swing Applet (Read 974 times)
P3D on Swing Applet
Feb 16th, 2010, 11:11am
 
Hello, I want to integrate an 3D Processing Applet inside my Swing Application. I've been able to make it work when using
   public void setup(){
       size(400,400);

but if i change it to
   public void setup(){
       size(400,400,P3D);

It does not displays a thing.
Thanks, Sebastian

Re: P3D on Swing Applet
Reply #1 - Feb 19th, 2010, 9:50am
 
Swing GUI does not support 3d rendering. So you should either use  another processing GUI library (controlP5, G4P, etc.) or follow this topic http://processing.org/discourse/yabb2/?num=1214781848 .
Re: P3D on Swing Applet
Reply #2 - Feb 19th, 2010, 6:50pm
 
Thanks for your reply, but I've finally got it to work.

Code:

public class Blag extends javax.swing.JFrame {
   Blag(){
       this.setSize(500, 500);
       setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
       javax.swing.JPanel pani = new javax.swing.JPanel(); //creating an independent Panel
       pani.setBounds(20, 20, 400, 400);
       processing.core.PApplet sk = new cubilio(); //cubilio is the class of my sketch that extends PApplet
       pani.add(sk); //this is important, you must add the PApplet on a panel of it's own
       this.add(pani);
       sk.init(); //starting the Processing Sketch
       this.setVisible(true);
   }
}
Page Index Toggle Pages: 1