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: 2 questions about GUI and one for my curiousity(multi thread)

  1. #1
    Member
    Join Date
    May 2011
    Location
    west palm beach, FL
    Posts
    189
    My Mood
    Tired
    Thanks
    41
    Thanked 11 Times in 10 Posts

    Default 2 questions about GUI and one for my curiousity(multi thread)

    hi I am still pretty new to java and im trying out making a GUI for my program. so i was wondering is it better to start the program making the GUI and add the rest with it as the GUI comes together? or is it easier to write the program for command line and then add in a GUI?


    this one is for my curiousity...when would a program benefit from being multithreaded? small programs that dont do much i guess wouldnt matter but when does it become beneficial to have it multi threaded?

    sorry for all the questions lately i hope when i learn a bunch more i can contribute some help to everyone else too thanks for any info you can give me


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: 2 questions about GUI and one for my curiousity(multi thread)

    Question 1: In my opinion it's best to write the logic, algorithms, etc...(in other words the model) completely separate from any user interface, and later plug into said model with other components - be it command line, swing, web, or whatever. This is the basics of the MVC (model, view controller) design pattern, which facilitates code re-use, maintenance, and a whole slew of other things. Of course this all depends upon what you are doing.

    Question 2: Multithreading allows parallel tasking. Take for instance a user interface, if the program needs to perform a long task the user interface may lock up while the task is being performed, so placing the long task into a thread will prevent this from happening. Another case might be a server handling requests from clients - doing so in multiple threads to handle each request.

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

    derekxec (June 29th, 2011)

  4. #3
    Member
    Join Date
    May 2011
    Location
    west palm beach, FL
    Posts
    189
    My Mood
    Tired
    Thanks
    41
    Thanked 11 Times in 10 Posts

    Default Re: 2 questions about GUI and one for my curiousity(multi thread)

    wow as always an excellent answer thanks very very much

Similar Threads

  1. Multi-CPU Thread Execution
    By bgroenks96 in forum Threads
    Replies: 4
    Last Post: June 26th, 2011, 11:31 PM
  2. Having Difficulties With a Multi Thread Code... Help?
    By Allicat in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 5th, 2011, 12:35 AM
  3. Help on 2D Multi Table Array
    By clevel211 in forum Object Oriented Programming
    Replies: 1
    Last Post: February 1st, 2011, 04:28 AM
  4. Converting Code to Multi Thread
    By cmill_xc in forum Threads
    Replies: 1
    Last Post: December 6th, 2010, 12:39 PM
  5. Multi-dimension ArrayList example
    By adeola in forum Collections and Generics
    Replies: 3
    Last Post: March 26th, 2010, 03:23 AM