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.
IndexProgramming Questions & HelpSyntax Questions › Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my
Page Index Toggle Pages: 1
Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my (Read 1295 times)
Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my
Nov 28th, 2009, 6:26am
 
Ok.. I'm at the point of begging Embarrassed please please please someone help me with this.  I've spent over a week trying to figure it out and I just lack the skill.  I do recontribute to the community and the forum.

Ultimately, I'm trying to embed a web browser component (like lobo, jdic, DJNativeSwing) into a processing sketch, but I need it to work in OpenGL and FullScreen Exclusive Mode.  I don't think the issue is with the web browser component, I've got these working fine using examples on this forum.

Here is the issue: I can embed the browser component into a frame or panel, but I can't get the panel to display in OpenGL.  I can't get a frame to punch through exclusive fullscreen mode.  However I try, I can't find a way to make the browser visible.  It gets pushed to the background, even when calling toFront() and other such foucs commands.  I prefer the panel (or something similar) to be embedded in the sketch but a separate frame that is visible would also work.

Here is an example that works fine, but add size(640,480,OPENGL) and the panel/buttons disappear.  Place it in presentation mode (fullscreen exclusive) and the panel/buttons disappear.  
Code:
import javax.swing.JButton;
import processing.opengl.*;  

void setup() {
 size(640,480);
 makeUI();
}

void draw() {
 background(0);  
 rect(300,200,20,20);
}

void makeUI() {
 setLayout(null);//lets us specify where to put objects
 Panel p = new Panel();
 p.setBounds(0,0,width,50);
 p.setBackground(new Color(255,0,0));
 
 JButton jb = new JButton("Green");
 jb.addMouseListener(new java.awt.event.MouseAdapter() {
   public void mouseClicked(java.awt.event.MouseEvent evt) {//button code
fill(0,255,0);
   }
 });
 
 JButton jbr = new JButton("Red");
 jbr.addMouseListener(new java.awt.event.MouseAdapter() {
   public void mouseClicked(java.awt.event.MouseEvent evt) {//button code
fill(255,0,0);
   }
 });
 
 p.add(jb);
 p.add(jbr);
 
 add(p);
}

The Swing buttons themselves may be a lightweight/heavyweight issue, but the panel I believe is AWT which should be heavyweight. (Note the buttons are just an example and will not be in my sketch).  HELP!  Make this panel (or some variation) visible so I can embed a browser component into processing. Smiley  I really need to make this happen and would be extremely grateful for the assistance.
Re: Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my
Reply #1 - Nov 28th, 2009, 8:15am
 
this is probably not what you want to hear but go with flash Smiley
sorry cant help you in this case.
Re: Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my
Reply #2 - Nov 28th, 2009, 8:30am
 
This is probably a stupid suggestion, but well...
If you can get a screenshot of your Web page, perhaps you can display it as an image. Interaction will be limited, though...
Re: Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my
Reply #3 - Nov 28th, 2009, 8:37am
 
Cedric, it's not a new sketch.  It's something I've been working on for a year and it's become a full program built with Processing.  So, this would be an addition to an existing Processing app.

PhiLho, interesting option... perhaps as a last resort (though I'm not sure how to do that dynamically as I have thousands of webpages).  I would certainly prefer some interaction, scrolling for the page, and text highlighting (which the web engines can do).
Re: Help PLEASE! PLEASE! Panels, OpenGL, Z-Order oh my
Reply #4 - Nov 28th, 2009, 2:54pm
 
hmm still have no idea but sounds like an interesting project you are working on. is it something that will become punlic some day ?
Page Index Toggle Pages: 1