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 integration
Page Index Toggle Pages: 1
JOptionPane integration (Read 1123 times)
JOptionPane integration
Nov 23rd, 2006, 1:17pm
 
Hi, I'm working on a project which will allow data entry using the JOptionPane swing function. I understand that the swing function will not embed within the processing applet (especially when you see that the code is placed before the size() function!!) However, I am not particularly sure what I need to do to make the OptionPAne work. Any opinions greatly appreciated

Code:
     
       
import javax.swing.JOptionPane;

int x;
int y;
 
void setup() {
 
 String input1 = JOptionPane.showInputDialog("Enter width and height of window, separated by spaces");
 String[] args = split(input1);
 x = int(args[0]);
 y = int(args[1]);
 
 size(x, y);
   
}


Page Index Toggle Pages: 1