Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2005

Tip: Looking for answers? Try searching our database.

Threads

Thread view: 
freesoft_2000@yahoo.com - 07 Feb 2005 18:08 GMT
Hi everyone,

                I have a question about threads. Consider the below
program

public class test
{

public void test1()
{
   System.out.println("Test 1");
}

public void test2()
{
   System.out.println("Test 2");
}

public void test3()
{
  System.out.println("Test 3");
}

public static void main(String args[])
{
  test a = new Jtest();
  a.test1();
  a.test2();
  a.test2();
}
}

As you can see above i have three methods in the above class. My
question is how do i call each of these methods in a separate thread
either in the class main or in the class itself

Consider the below method

public void test()
{
   System.out.println("Test 1");   //command line 1
   System.out.println("Test 2");   //command line 2
}

As you can see from the above method i have two command lines in the
above method. My question is how do i call each command line in a
separate thread.

Basically i need to know how to call a specific method or a specific
command line in a separate thread excluding the main thread

I hope someone can help me with both these questions

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
Thomas A. Russ - 08 Feb 2005 17:53 GMT
> Hi everyone,
>
>                  I have a question about threads. Consider the below

Not sure what this has to do with GUIs, but start here:

http://java.sun.com/docs/books/tutorial/essential/threads/index.html

Signature

Thomas A. Russ,  USC/Information Sciences Institute



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.