Threads Program #2

  • Permalink
  • submit to reddit
  • Email
  • Follow


Hello friends,
                        I am new to Java and I need your help in doing
these thread programs

1) Create 2 threads. First thread provides a string to the second
which checks whether the given string is a palindrome or not.

2) Write an applet program which has 2 buttons called increase and
decrease on the system thread. The child thread should display a line
numbers from 1 to 30 and back to 1 displaying different positions.
When the increase button is clicked, the sleep thead increase and an
action on the decrease button should decrease the sleep time of the
thread.


Looking forward to your suggestions

THanks

Nish

0
Reply nishant.friend (14) 4/1/2007 3:38:43 AM

See related articles to this posting


On Apr 1, 1:38 pm, "nish" <nishant.fri...@gmail.com> wrote:
>..I am new to Java and I need your help in doing
> these thread programs

You seem very needy..
<http://home.earthlink.net/~patricia_shanahan/beginner.html>
Beyond that, do a search for 'java tutorial' with
a key word related to the program, e.g. 'thread'
'canvas' 'mouse'..

Andrew T.

0
Reply Andrew 4/1/2007 6:37:00 AM
comp.lang.java.gui 8293 articles. 15 followers. Post

1 Replies
352 Views

Similar Articles

[PageSpeed] 25


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

using threads to access 2 different programs #2
Hi, I am kinda new to pthreads programming in C. The problem I am facing is... I need to access routines from 2 different programs using 2 different threads. How do I do it? To be more specific.. the picture is... software_thread.c hardware_thread.c void software_thread void hardware_thread { { } } main.c void main() { pthreads software_t, hardware_t; pthread_create( software_t,attr, software_thread, args); pthread_create( hardware_t,attr, hardware_thread, args); } These are 2 different programs. ...

program #2 #2
can nybody help me out to solve this problem, Problem::: Consider a domestic Airport which has two runways. A flight takes 10 minutes to land .Assume the flight is ready to land.Each runway can be used by only one aircraft at any given time.The landing flight run on the free runway.If more than one flight needs to land then available runways then check the fuel reservers at both the flight are more than 10000 gallons then the flight longest time waiting get the preference & if the fuel reserve is less than 10000 gallons than the flight having lesser fuel resreve get the preference . Ass...

Threads #2 #2
Hi, I am new to the world of threads and process. cud any of u please help me get info on these stuffs. ur help is sincerely appreciated. thanks. Barry Hey Barry, Maybe I'm wrong, but I think threads are OS-dependant, hence nothing to be with this newsgroup. If you're going to use POSIX threads, you can take a look at: http://dis.cs.umass.edu/~wagner/threads_html/tutorial.html David. Barry wrote: > Hi, > > I am new to the world of threads and process. cud any of u please help > me get info on these stuffs. ur help is sincerely appreciated. > > thanks. >...

comp.programming.threads #2
adfg ...

threads 2.6.2 on linux x86_64: thread::create hangs
Hello all and Zoran ;-), on a Fedora Core 4 installation, with (recompiled) tcl 8.4.12: $ strace tclsh % package require Thread 2.6.2 % thread::create .... write(1, "% ", 2% ) = 2 read(0, thread::create "thread::create\n", 4096) = 15 mmap(NULL, 10489856, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|0x40, -1, 0) = 0x40a01000 mprotect(0x40a01000, 4096, PROT_NONE) = 0 clone(child_stack=0x41401270, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED, ...

Crash in thread on program termination #2
This is a multi-part message in MIME format. ------=_NextPart_000_0100_01C533C2.AE98AB00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit I just recently came across this post from the mailing list: http://mail.python.org/pipermail/python-list/2005-February/265569.html in which the error with daemon threads at interpreter shutdown is discussed. I have experienced this problem in numerous programs that I've written and wanted to write in with a solution. I don't know if this has already been discussed elsewhere, but I could not find it. Bug #...

OS/2 C60 programs converted into MS windows programs?Information on OS/2 C60?
Hello, all I am working on a project that needs to convert OS/2 C60 programs into MS windows programs. And I found it difficult to find useful information. Could somebody kindly help me ? any tips?web sites? 1. How can I convert OS/2 C60 programs into MS windows programs? 2.Where can I find information on OS/2 C60 ?any web sites...? 3. What are the difference between variable types in OS/2 and in MS windows? Any tips are appreciated. Coca In article <g95ci0p98npj1f40pldt888mo286km1fme@4ax.com>, Coca <bigmelon@btamail.net.cn> wrote: >I am working on a project that nee...

Socket Programming #2 #2
Hi All, I'm a newbe to socket programming, I need to work on a project that has to be developed in C++ or Visual C++ ( I have 8.0 version) console application. which will be execute from a Java GUI application using dos command and pass a userid, password and a port number( to connect back to Java GUI using TCPprovided ) using the user and password information I need to connect to a vendor using there API and get the information from the vendor and pa it back to the Java GUI appl using the port number provided. Some of my questions How do I connect back to Java GUI using the provided por...

Network Programming #2 #2
Network What the hell is the point of this post? ...

using threads to access 2 different programs
Hi, I am kinda new to pthreads programming in C. The problem I am facing is... I need to access routines from 2 different programs using 2 different threads. How do I do it? To be more specific.. the picture is... software_thread.c hardware_thread.c void software_thread void hardware_thread { { } } main.c void main() { pthreads software_t, hardware_t; pthread_create( software_t,attr, software_thread, args); pthread_create( hardware_t,attr, hardware_thread, args); } These are 2 different programs. ...

Threads with Python 2.2.2 on Red Hat 9.0
I am seeing some problems with threads on Red Hat Linux 9.0. With no LD_ASSUME_KERNEL environment variable set, a large proportion, possibly 20%, of threads do not run. They are created OK and their __init__ which includes a setDaemon(1) is successful. start() is called on the thread object and a message successfully displayed after the start() call. But no message is produced by the thread's run() method. The thread class is derived directly from threading.Thread and in its __init__ calls threading.Thread.__init__(self) before calling self.setDaemon(1). The problem can be ...

Re: [9fans] current state of thread programming #2
Roman V. Shaposhnik writes: > If we were to oversimplify things [then the] brain >is, at its core, limited by a very fundamental biological constraint: >speed at which cells can communicate. A sort of "propagation delay" >if we were to use electronics as an analogy. It seems to be agreed >upon(*) that we can safely assume this constraint to limit our brain >to about couple of hundred of processing steps per second. This is >known as a "100 steps rule". > Something is really, really wrong with >the compu...

Linux pthreads, C-program, how to timeout a thread? #2
I've done several searches but can't find anything really specific to what I'm doing. This is the first program I have ever used threads with. The program talks to a serial port with standard Linux read/write function calls. However, those are blocking calls, like the read, it will block until there is something to read. I don't want a broken link to stop the whole program, so I'm using threads. I have a modbus thread and a logic thread. The modbus thread does the actual reading/writing on the serial port and updates a global array of values (using the mutex lock/unlo...

Segmentation fault returning value in Thread for Tcl 8.3.5/Thread 2.5 (2.1.5)
I wrote a simple "exec" function that runs the specified program in another thread, splits out the stdout and stderr output and returns asynchronously. (I attached the script and traceback from the core dump at the end of this message.) I started off using Tcl 8.3.5/Thread 2.5 (2.1.5). It seems that if the script running in the other thread returns a value using "return $result", I get a core dump. But, if I return the value using "set result", it doesn't core dump. If I use Tcl 8.4.5/Thread 2.5.2, the script throws an error condition if I use "re...

2 Courses - Seattle
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to announce 2 courses in Seattle this June. Same week! (1) R/Splus Fundamentals and Programming Techniques *** June 5-6, 2006 *** http://www.xlsolutions-corp.com/Rfund.htm (2) R/Splus Advanced Programming *** June 8-9, 2006 *** http://www.xlsolutions-corp.com/Radv.htm Ask for group discount and reserve your seat Now - Earlybird Rates. Payment due after the class! Email Sue Turner: sue@xlsolutions-corp.com (1) June 8-9, 2006 R/Splus Advanced Programming Course Outline: - Overview of R/S fundam...

linspace(2,2,2) returns [2 2] ??
May be the help for linspace should change? It says: "LINSPACE(X1, X2, N) generates N points between X1 and X2." Notice, it says BETWEEN. But when I ask for 2 points, between 2 and 2: ---------------- EDU>> linspace(2,2,2) ans = 2 2 --------------- May be mathematically this is ok? i.e. there are infinite points between the point and itself? (on the real line), but from programming point of view, it is confusing. no? --Nasser Maybe it should say "generates N points between X1 and X2, inclusive." What did you expect to...

2 * 2 * 2 * 2 or pow(2, 4)?
Hi , I hope this isn't too trivial to ask, but I'm evaluating a polynomial that involve lots of terms like x^2y^2z^3, and although I can use the power function pow(a, b), I wonder if just writing x*x*y*y*z*z*z for example wouldn't be more efficient than pow(x, 2)*pow(y, 2)*pow(z,3). Or is it all the same? Thanks, - Olumide Olumide wrote: > I hope this isn't too trivial to ask, but I'm evaluating a polynomial > that involve lots of terms like x^2y^2z^3, and although I can use the > power function pow(a, b), I wonder if just writing x*x*y*y*z*z*z for > exam...

2**2**2**2**2 wrong? Bug?
In Python 2.5 on intel, the statement 2**2**2**2**2 evaluates to >>> 2**2**2**2**2 20035299304068464649790723515602557504478254755697514192650169737108940595563114 53089506130880933348101038234342907263181822949382118812668869506364761547029165 04187191635158796634721944293092798208430910485599057015931895963952486337236720 30029169695921561087649488892540908059114570376752085002066715637023661263597471 44807111774815880914135742720967190151836282560618091458852699826141425030123391 10827360384376787644904320596037912449090570756031403507616256247603186379312648 4703743782954975613770...

Re: Easiest way to make sure 2 sas programs (2 files) are the same? #2
I think it only copies and only on UNIX. Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com If you torture data sufficiently, it will confess to almost anything. -----Original Message----- From: Pardee, Roy [mailto:pardee.r@GHC.ORG] Sent: Friday, January 28, 2005 2:45 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Easiest way to make sure 2 sas programs (2 files) are the same? cp myfirstprog.sas mysecondprog.sas LOL--sorry, couldn't resist. -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Igor Kurbeko Sent: Frida...

Attn:Mark Space... My Ascii 2 Hex back 2 Ascii program. #2
Forgot to ask:What is a better method to detect the EOF than the searching for a -1 value? I'm assuming -1 is the integer value placed at the end of all files? Robert Blass wrote: > Forgot to ask:What is a better method to detect the EOF than the > searching for a -1 value? > > I'm assuming -1 is the integer value placed at the end of all files? There is no fixed value at the end of all files, and -1 can appear in the middle of a file. Each method that reads data from files should have documentation that indicates what happens if it reaches end of file. For example, ...

Freeze with wxpython on python 2.3 or python 2.4 on Win32 with Thread #2
Hello i have a problem with thread and wxpython on WIN32. With this script : I would like to SetValue to my gauge widget in a thread. I can GetValue without a hitch but if I SetValue it freezing. Try following script and go to AF-Tools Menu and click install Normally in the install thread, I wrote "yo" in the console and I SetValue of the gauge passed to the thread. from wxPython.wx import * from wxPython.wizard import * from os import * #import os #import win32wnet, win32netcon #import wmi #import win32api #import _winreg import time #import win32com,win32com.client import sys...

thread 2.6 problem #2
hi everyone. i'm newbie of multi-threading in TCL. i have installed "thread 2.6.3". my program : package require Thread 2.6.3 proc proc1 {} { while {1} { puts "world"; } } thread::create -joinable proc1 while {1} { puts "hello"; } on execuitn this TCL script, i get the folowing error message : can't find package Thread 2.6.3 while executing "package require Thread 2.6.3" (file "/home/prb/tcl/ex.tcll" line 3) can anyone help me in this regard. thanks, Prabhu Try to add this line...

2 clients 2 servers with threads
Hello, I would like to implement a Perl script which receives data from 2 clients via a socket connection and prints the result to standard out. My idea would be to establish 2 connection with 2 servers one after the other (I do this for example with Telnet console) then create the reading threats both doing a while(1)-loop and wait in the program in a while(1)-loop. I experience 2 problems: 1) second argument of readClient is the client name which would tell me which client prints data. even though stdout prints "CLIENT1" and "CLIENT2" data was only send from ...

TUTORIALS ON COMPUTER PROGRAMMING #2 #2
languages Have the complete details regarding programming languages. A-Z about programming languages like Java J2EE, C++, code implementation guides and more. http://operatingsys.blogspot.com/ ...