Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Java > Threading

Threading - Page 3

41-60 of 71     Previous     Next
Create Timer Threads Using the Swing Timer Class
by Ajit Sagar
The Swing package, which is now a standard API package in Java 2, offers a new timer utility. This utility is implicitly threaded and lets you create as many timer threads as required, while ...
Create a Timer Using the Static Sleep() Method
by Ajit Sagar
The simplest way to create a timer in Java is to use the static sleep() method on the Thread class. This code shows a main class that has a while loop for implementing the timer. The argument read ...
Get a Free Grip on the Output of the Process Object
by Behrouz Fallahi
There are times when you have to use the exec(...) method of java.lang.Runtime class to launch a program. For ...
Optimize Your Scripts in DHTML When Accessing a Collection
by Jai Bardhan
A typical operation in DHTML is to iterate through a collection of objects. Let's say you're writing an HTML application that indexes content. Your task is to collect all the H1 elements on a ...
Running Piped Threads
by Ajit Sagar
Each piped thread has a run() method, and in an application using piped streams, their run() methods are interdependent. These code excerpts illustrate the run() methods for a PipedInputStream ("in_") and a PipedOutputStream ("out_").
Threading Piped Streams
by Ajit Sagar
Though piped streams are typically used in separate threads, you can use this class to connect them together.
Using Piped Streams in an Application
by Ajit Sagar
Learn how to create and use the PipedInputStream and PipedOutputStream objects in separate classes and in separate threads.
Java Virtual Machine Doesn't Exit
by Brett Spell
You may have been surprised and frustrated to find that in some cases, the Java Virtual Machine (JVM) does not stop running when your application exits the static main() method. For ...
Connecting the Piped Stream Classes
by Ajit Sagar
The no-argument default constructors for the piped stream classes create streams that are not connected to any other stream. This code shows you how to connect them.
Thread Timing
by DevX Pro
How can I determine the total time it takes for a set of threads to execute?
Event Thread and Painting
by Brett Spell
Java uses the event thread to notify listeners of events by making calls to methods such as actionPerformed() and itemStateChanged(). However, this same thread is also responsible for repainting ...
Pass Data Between Threads Using Piped Streams
by Ajit Sagar
These "piped stream" classes allow your program to read data into an input stream and write it out through an output stream in a single method call.
A Runnable Is Not a Thread
by Behrouz Fallahi
You may come across some situations where implementing a Runnable may have some advantages over extending Thread. If the class you are going to multi-thread is already extending another class, you ...
Starting a Thread Using the Thread Class or the Runnable Interface
by Ajit Sagar
You can start a thread in Java by either implementing the java.lang.Runnable interface or by extending the java.lang.Thread class (see Tip
C++ and Multithreading
by Danny Kalev
Standard C++ does not directly address the issue of multiprocessing, threads, and thread safety. This issue is implementation dependent, which enables vendors to decide whether or not to provide ...
Weaving Threads
by Ajit Sagar
Java provides two ways to create and run a thread. You can implement the Runnable interface or extend the Thread class. The Runnable interface defines a single method run(). Consider the following ...
DHTML Window Redraw
by DevX Pro
Is there any way to control the redrawing/repainting of the open window/document? Specifically, I have to change page elements (labels, cursor style) before calling some time intensive task. I have successfully implemented changes to the cursor style but it doesn't always change the display of the mouse cursor immediately.
Delaying a Program
by DevX Pro
Can you please tell me how to delay the program flow in Java? I can't find any implementation of delay().
Splash Page Creation
by DevX Pro
I would like to show a splash page and have it time out after approximately five seconds. How do I do that?
Java Threads and Multiple Processors
by DevX Pro
On a Windows NT box with multiple processors, will a multithreaded Java application get split between the processors automatically?
41-60 of 71     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date