Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: GUI - Should it be in its own thread?

  1. #1
    Member
    Join Date
    Nov 2009
    Posts
    57
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default GUI - Should it be in its own thread?

    Hi

    Still new to Java, and hopefully this is the right section to post this question.

    When creating a Java Swing gui should it be in its own thread rather than being ran under the thread of the Main method. Or does Java handle the GUI events etc under its own thread by itself.

    Thanks


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,723
    My Mood
    Hungover
    Thanks
    147
    Thanked 681 Times in 580 Posts

    Default Re: GUI - Should it be in its own thread?

    Everything involving Swing should be done on the Event Dispatching Thread, or EDT. Check out the invoke methods of the SwingUtilities class. SwingUtilities (Java Platform SE 7 )
    How to Ask Questions the Smart Way
    Static Void Games - GameDev tutorials, free Java and JavaScript hosting!
    Static Void Games forum - Come say hello!

  3. The Following User Says Thank You to KevinWorkman For This Useful Post:

    mds1256 (October 20th, 2012)

  4. #3
    Member
    Join Date
    Nov 2009
    Posts
    57
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Default Re: GUI - Should it be in its own thread?

    Thanks will do.

Similar Threads

  1. Replies: 2
    Last Post: August 30th, 2012, 10:45 AM
  2. Replies: 4
    Last Post: June 15th, 2012, 02:50 PM
  3. My First thread
    By shyandeep chatterjee in forum Member Introductions
    Replies: 0
    Last Post: April 18th, 2012, 06:06 AM
  4. What is this thread for exactly?
    By javapenguin in forum Computer Support
    Replies: 2
    Last Post: July 2nd, 2011, 11:37 AM
  5. Thread to EDT
    By Asido in forum Threads
    Replies: 3
    Last Post: October 15th, 2010, 02:13 PM