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 › JOptionPane and P3D conflict
Page Index Toggle Pages: 1
JOptionPane and P3D conflict? (Read 916 times)
JOptionPane and P3D conflict?
Nov 9th, 2006, 4:21pm
 
Hi, I don't know if anyone has ever come across this but if I try and use the JOptionPane Input Dialog box function and I am using P3D (as in size(200,200,P3D)) then it will refuse to run the program and will present you with another dialog box which you cannot use or close.

Any thoughts?

Code:

void setup()
{
 String input = JOptionPane.showInputDialog("Enter number of boxes");
 String[] args = split(input);
 num = int(args[0]);
 
 size(300, 300, P3D);
Re: JOptionPane and P3D conflict?
Reply #1 - Nov 9th, 2006, 7:42pm
 
1) size() *must* be the first thing inside setup, as stated in the reference.

2) swing components are not thread friendly, and you probably need to put that inside a SwingUtilities.invokeLater() block (see the swing tutorial about this).
Page Index Toggle Pages: 1