Computer Science Canada

More Swing Help needed...

Author:  Jodo Yodo [ Sat Apr 09, 2005 6:23 pm ]
Post subject:  More Swing Help needed...

Okay, I get an error with createAndShowGUI (), and I dont' know why.

Author:  Hikaru79 [ Sun Apr 10, 2005 8:24 am ]
Post subject: 

createAndShowGUI() can throw an IOException. Replace
Java:
public void run() {
                createAndShowGUI();
            }

With:
Java:
     public void run(){
                try{
                createAndShowGUI();
                }
                catch (IOException f){System.out.println(f);}
            }


And all will be well Smile Doesn't RTP tell you these things? NetBeans 4.0 did right off the bat. Try http://netbeans.org . Ask not what you can do for your IDE, but what your IDE can do for you!

Author:  rizzix [ Sun Apr 10, 2005 9:55 am ]
Post subject: 

NOOOO!!! dont ever do that. unless that is the ONLY thread used for GUI stuff. if not then DONT. and re-design ur appliaction..

good heavens... never never never create or call swing objects from multiple threads.. (this inlcudes the main-thread)

Author:  Hikaru79 [ Sun Apr 10, 2005 1:36 pm ]
Post subject: 

rizzix wrote:
NOOOO!!! dont ever do that. unless that is the ONLY thread used for GUI stuff. if not then DONT. and re-design ur appliaction..

good heavens... never never never create or call swing objects from multiple threads.. (this inlcudes the main-thread)


Rizzix, there's more than just that. He's holding the movie statistics in the same class -- it's a total butchering of the MVC architecture (the whole program is only one class). However, this project is due tomorrow, so right now is not the time to be bringing these things up for him Sad


: