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 & HelpIntegration › Swing Popup over Fullscreen P5
Page Index Toggle Pages: 1
Swing Popup over Fullscreen P5? (Read 556 times)
Swing Popup over Fullscreen P5?
Nov 24th, 2007, 10:36pm
 
Hi all,
 I have a couple of instances in a sketch I'm writing where I'd like a Swing window to pop up over a P5 sketch in fullscreen mode and remain on-top until the user enters some data.  I've inserted the code to create, instantiate and draw the Swing window into my sketch and it works so long as the P5 sketch isn't fullscreen, but in fullscreen, nothing!  I'm using myFrame.toFront() to try and drag the frame to the foreground.

Thoughts?  I would use one of the P5 GUI libraries -- in fact, I'm already using ControlP5 in other parts of my sketch -- but I need to use the JPassword and JTextArea (or similar) components and ControlP5 doesn't have analogs for those. I know I could switch UI toolkits, but at this stage in the game I'd rather not start over from scratch with the rest of my sketch to add one new feature.

Cheers,
Ryan
Re: Swing Popup over Fullscreen P5?
Reply #1 - Nov 25th, 2007, 2:00am
 
http://processing.org/faq.html#java
Specificly:
Quote:
The main rule when using Java code: You cannot use anything from the AWT or Swing (which is built on the AWT), because it will interfere with our graphics model If you want to add scroll bars and buttons to your projects, you should make them using Processing code, or embed your Processing applet inside another Swing or AWT application (see below). Even if they appear to work, such sketches are likely to break when you try to run on other operating systems or other versions of Java.
Re: Swing Popup over Fullscreen P5?
Reply #2 - Nov 25th, 2007, 4:43am
 
And I just got burned by the first (and only) rule in the sticky. Sorry!

Does this still apply when creating a new Swing JFrame? ie, not inside/on the PApplet's canvas, but a second JFrame instantiated by the main sketch?
Page Index Toggle Pages: 1