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 › Processing with swing dialog box - need comments
Page Index Toggle Pages: 1
Processing with swing dialog box - need comments (Read 744 times)
Processing with swing dialog box - need comments
Oct 7th, 2009, 11:29am
 
A while ago I tried to display swing dialog box to get user input numbers. I had some trouble but got help from a few of the processing veterans on the discussion board that I can use noLoop() and loop() to enclose a swing dialog box. It works perfectly.

I've done some reading and found how to invoke some code on separate threads by using the following syntax:

SwingUtilities.invokeLater(new Runnable() {  
     public void run() {
 
        javax.swing.JOptionPane.showMessageDialog(frame,"Hello!");
     }  
   });  

This way does work without adding noLoop() and loop(). My question here is: could the processing veterans comment on the pros and cons of this method? I'd like to write a stable program. Thank you! ^_^
Page Index Toggle Pages: 1