Threads Program #2

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
4/1/2007 3:38:43 AM
comp.lang.java.gui 8306 articles. 15 followers. Post Follow

1 Replies
412 Views

Similar Articles

[PageSpeed] 45
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
Andrew
4/1/2007 6:37:00 AM
Reply:
Similar Artilces:

ThreadPoolExecutor
Hello, In the ThreadPoolExecutor (TPE), is the callback always guaranteed to run in the same thread as the submitted function? For example, I tested this with the following code. I ran it many times and it seemed like `func` and `callback` always ran in the same thread. import concurrent.futures import random import threading import time executor = concurrent.futures.ThreadPoolExecutor(max_workers=3) def func(x): time.sleep(random.random()) return threading.current_thread().name def callback(future): time.sleep(random...

[ADMIN] Welcome to comp.std.announce! #2
Archive-name: usenet/comp.std.announce/welcome Posting-Frequency: twice monthly Last-modified: 2006/08/04 Version: 1.1 URL: http://www.killfile.org/~tskirvin/faqs/csa.html comp.std.announce (CSA) is a newsgroup for publishing announcements of new and/or modified internet standards and practices, such as RFCs, ISO standards, web standards, and so forth. CSA is a robo-moderated forum, controlled by a moderation 'bot that automatically approves messages from a set whitelist of mailing lists. HOW TO POST =========== comp.std.announce is set up with the assumption that it wil...

PHP (PHP Hypertext Preprocessor) Programming is Similar to C ... #4
PHP (PHP Hypertext Preprocessor) Programming is Similar to C ... PHP programming is similar to C / JavaScript and Java. ... Modeling Agencies - Helping Teen Models =B7 Fashion and Success - Starting a Retail ... Read More http://childschooledu.blogspot.com/ ...

load large matrix and calculate eigenvals #2
Hi, I have a large matrix 30,000x30,000 stored in text file(~10G in size), and I want to find the eigenvalue and eigenvector for it and print it to another text file. I am wondering how can I do it using parallel computing package( or else I get "Out of Memory" error and I am doing the computation on a cluster) Thank you! Xin ...

chart programming
Hi I am interested in programming something like windows task manager performance tab ( CPU Usage History , Page File Usage History ) in C language ( C++ it's ok but my first choice is C ). I know window programming ( not a newbie neither an expert ) and I want to ask if exist as a standard control in windows API or I must fix it by zero. Also if anyone know some library or some free code for programming charts for windows it would be nice. I use MS visual studio 6. ( If something exist in .NET version don't hesitate to tell me ) Thanks db_happy writes: > I am interested in pr...

To thread or not to thread
My app needs to check a number of things on the web. This can be done in the background. I use idHTTP to pull data in. This process is broken down into small parts and the subroutinen are called in the OnIdle handler of the main form. I notice that sometimes idHTTP needs a considerable time to build the connection/fetch the data and the application doesn't repond to user actions during such periods. To cope with this I have now implemented the web data fetching in a thread with priority tpIdle. I think the problem of non-response has gone, ut it is difficult to test. Am...

Messaging between threads
Hi All, I have written an multithreaded application on Win32 Platform. The backend of the application consists of 3 threads and is coded with Win32 API , while my frontend or GUI is developed using MFC. The GUI is entirely a different thread or the main process thread. I have to send messages to my GUI thread from the backend threads. I used SendMessage Function for the same but using that caused my application to stall. Then I used postmessage function which solved my problem. But now I m having a problem that my application responds slowly to any event occurring. Please help me ou...

My my my #2
Just testing Black Dog wrote: > Just testing My my my, you failed. ...

listener-thread err -930
Hi Folks: I've just got a listener-thread err -930 on a new instance I put up last Friday. This box is in my test bed and is not critical but I would like to know why when I load data from my production server on this test server then shutdown Informix it generates this -930 error when I try and start it up again. I've checked the sqlhosts file and the entry seems correct but there must be some configuration file out of sync. This is on an older AIX box and the database was created using the ISA. ...

Pipeline thread model
I want to build the C++ class for pipeline thread model that each thread will be assigned a fixed tasks, it process the input and send output to the next stage. Because i'm inexperienced with thread programming so I need some help for my starting point. - First of all, do I need separated input and output buffer for each threads on the pipeline. Can I shared the buffer between the output of one stage to the input of the next stage. What is the better option. - Second, how many thread I need for one pipeline stage. I can see one option that require 3 threads for one pipeline stage: ...

wx threads and blocking IO broblem
Hi. My program deals with the blocking IO, and to achieve the efficiency, I am using threading. The technique is rather standard: I am creating the reader thread, which blocks in a read() syscall, and as soon as it has data, it sends the events to the main thread. This works rather well till the moment when I need to stop the reader thread. Naturally, the sequence would be the following: 1. notify the reader that it have to terminate 2. interrupt the blocking syscall 3. wait for termination 4. delete the thread object 3 and 4 are obvious. It is unclear how to achieve 2. Does...

Terminating a Worker Thread
Consider this example program... The main thread starts, creates a worker thread, waits for some signal, then terminates the worker thread before rejoining it and exiting. In my "keep it simple" mindset, I figure that if I just pass the thread a boolean flag and set the flag in the main thread when the worker needs to exit, the worker can be pretty simple: void * worker (void * data) { bool * done = (bool *)data; while (! *done) { // ... } return NULL; } As long as it can periodically check the flag I should be set. I do have ...

learning #2
Hi, Im interested in teaching myself how to program properly on Arcs and PCs. I can do a bit of Basic and thats about it. Can anyone suggest some good websites / books / intelligent monkeys I might be able to teach myself from. Any and all languages really. If someone can suggest sources for PC programming too Id appreciate it Thanks Jon In message <1148313462.589300.124940@y43g2000cwc.googlegroups.com> "Jon Dallimore" <dallimoj@coventry.ac.uk> wrote: > Hi, > > Im interested in teaching myself how to program properly on Arcs and > PCs. I can...

thread::pool : job whon't start after a idle thread has exited.
tcl 8.4 thread 2.5.2 sol 8 Command to create a thread pool package require Thread set tpId [tpool::create -maxworkers 4 -idletime 10 -exitcmd "puts end"] Command to submit job: tpool::post $tpId {puts allo} The first time that i submit the job i get allo if i wait 11 seconds i get end, no allo my job doesn't get run, why? If i submit an other i get allo. Is there a bug when a thread gets idle and exit? David David@capitale.qc.ca (David Paquin) wrote in message news:<c72a3ff5.0308081127.2a5d5ff8@posting.google.com>... > tcl 8.4 > thread 2.5.2 > sol...

Help! #2
I am trying to add a gradient to this picture: http://www.geocities.com/gjohanns101/image2.zip I would like to have a "purple-ish" motion blur behind each of the three "tear drops" and behind the black square. I have denoted the direction of the gradients in the image. What I envision it looking like is a spinning pin-wheel, sort of� With purple motion blurs behind each of the "spokes". The best I have come up with so far is a solid disk that looks like a purple CD-ROM. It would take me days to erase all of the areas that I don't want from a solid disk. Anyo...

thread communication
hello, ' i would like to developp an application with a master and ten&nbsp; threads&nbsp; which are in a listening state of datas. To realize this,&nbsp; each thread must control the presence of&nbsp;datas in it own pipe and can write datas in it pipe too. &nbsp;i have already realize this with fifos, but&nbsp; i don't know if must use two fifos for the communication between the master and one thread or only one, because when the&nbsp; master has written a data in the pipe of the thread, he takes a state of "wait the acknoledge". &nbsp; &...

ANN: Email Photo Sender 1.0
Email Photo Sender 1.0 is a batch software tool to send all your photos with one command line to your preferred internet photo services (like Flickr, Instagram, ...), to your friends, ... using email. e.g. emailphotosender *.jpg will send all your files with extension jpg in the directory where you run the software (one email for every file) to the email you set in emailphotosender.cfg by the email you set in emailphotosender.cfg using the smtp set in emailphotosender.cfg The name of the file will become the title and the description of the image so we suggest you to rename the file n...

javax.swing.Timer blocking program termination
So I have this program that uses a couple of javax.swing.Timers. I forgot to put in code to stop one of the timers yet the program would still terminate. I have set the default close operation for the frame to be DISPOSE_ON_CLOSE. What I found was that a timer of less the 1000ms would prevent an application based on a JFrame from stopping but 1000ms or more and it would stop just fine. I know that javax.swing.Timer uses a common thread for all timers but I don't see anywhere that describes the stopping behavior. The program below will stop if the JFrame is closed and...

Great Job Board #2
--_NextPart_00009763-00000843-0CE6F984-7AA4 Content-Type: text/plain Content-Transfer-Encoding: 7bit There is a great job board located at the employment section of http://www.4charlesson.com . So pass it on to anyone looking for a job. --_NextPart_00009763-00000843-0CE6F984-7AA4-- ...

Re: DNS bind-9.2.2-13 not working
The reason for specifying multiple servers is to provide REDUNDANCY. Giving two names to the same machine does not provide redunacy and just wastes bandwidth. ns1.polychip.net. 2D IN A 67.95.110.169 ns2.polychip.net. 2D IN A 67.95.110.169 I suspect you problem is a firewall. You need to open up both 53/UDP and 53/TCP. Mark > Hi, > > I have been trying to set up the dns for the past 1 week with no > luck..If i dig any other website from the local redhat linux machine > where this DNS is configured then it works fine, us...

Is 'dd' thread safe?
can multiple threads (or even processes) do raw i/o jobs simultaneously to block devices such as /dev/hdx or /dev/sdxx ? i mean... in user mode. i have to diagnose hard disks(ide, scsi...) and want to know the most efficient and grace way. any suggestions or idea would be appreciated. thanks. In article <8f0a8dae.0401140117.45f49bc@posting.google.com>, newton wrote: > can multiple threads (or even processes) do raw i/o jobs > simultaneously to block devices such as /dev/hdx or /dev/sdxx ? i > mean... in user mode. Yes, the Linux kernel is thread safe and does all ...

GIS jobs #2
Hello all, FYI, we've had a couple of new GIS career opportunities recently posted at http://www.lbszone.com/careers/ these may be of interest to some of you Best Glenn ============================== Glenn Letham / Managing Editor LBSzone.com & GISuser.com info@gisuser.com www.GISuser.com Register for our Free GIS/LBS Newsletter - register online or with a simple reply "subscribe" email message. "The complete resource for the GIS & Geospatial technology user!" ============================== ...

java uml program
Are there any free UML diagramming tools for java ? There are plenty of free 30 day trial versions, but is there one written in java which is completely free ? You could use Eclipse and use any one of many UML plug-in tools. http://www.eclipse.org/ Nice page for Eclipse and its plug-ins "Eclipse-Wiki.Info web site" http://eclipse-wiki.info/ Eclipse Plugin Resource Center and Marketplace http://www.eclipseplugincentral.com/ Eclipse Plugin http://eclipse-plugins.info/eclipse/index.jsp Could try a product called BlueJay http://www.bluej.org/ . I thought it was somewh...

Solaris OS versions supported on the cool thread series
Im trying to "leverage" (I hate that word : > ) one or more T2000's for a customer. The software to be installed is supported on Solaris 9 only and AFAICT even Solaris 9 mu8 CDs wont boot on this architecture. I find it hard to accept that Sun would put out a box that wont run 3rd party software. Im not talking about compatibility here - Im sure it likely IS compatible. Im talking support from the 3rd party vendor which wont happen if you dont follow their prerequisite rules to the letter. Its always been my experience that tech support will bail on you if you dont comply. Fo...

RE: Database design errors, domains, and Ingres #2
Hello, I must be really old fashioned - my preference is to place the responsibility for abstract data types into the domain of the business logic. I believe the server should be concentrating more on traditional values: performance, availability, locking contention, etc. (I'm not anti-stored procs, just biased towards simple types). How do you think the database should treat a case like this?: Invoice sales table has a quantity and a uom. eg 1 CTN = 1 carton. uom table has weight conversion factors. KG = 1, TON = 1000, TUB = 0.25, CTN = 6 (note the implied conversion from th...