In the following multithreaded applet only the first thread is getting executed? <p>The program is sending packets from sender to receiver and back to sender from receiver. It is using thread for each packet but only first packet is traversing the route.</p> <pre><code>import java.applet.Applet; import java.awt.*; import java.util.ArrayList; import java.util.*; public class CongestionControl extends Applet { ArrayList&lt;Packets&gt; packetList = new ArrayList(); static int width, height; int packetCount; static int sourceLocationX; private Label ls = new Label("Sender"); private Label lr = new Label("Reciever"); int sourceLocationY; int SWS; int packetWidth; int packetHeight; static int destLocationX; Random random = new Random(); int RTT; public CongestionControl() { sourceLocationX = 100; sourceLocationY = 200; destLocationX = 400; RTT = 5; SWS = 4; packetWidth = 10; packetHeight = 10; packetCount = 10; } public void init() { width = getSize().width; height = getSize().height; setLayout(null); for (int i = 0; i &lt; packetCount; i++) { packetList.add(new Packets(sourceLocationX, sourceLocationY, Math .round(((2 * (-sourceLocationX + destLocationX)) / RTT) + 2))); // adding 2 purposely } add(ls); ls.setBounds(100, 240, 140, 30); add(lr); lr.setBounds(destLocationX + 20, 240, 140, 30); } private class MovingRunnable implements Runnable { private final Packets p; private MovingRunnable(Packets p) { this.p = p; } public void run() { for (;;) { p.move(); repaint(); try { Thread.sleep(200); } catch (InterruptedException e) { e.printStackTrace(); } } } } public void start() { for (Packets packet : packetList) { Thread t; t = new Thread(new MovingRunnable(packet)); try { Thread.sleep(RTT / SWS); // packet generation interval } catch (InterruptedException e) { e.printStackTrace(); } t.start(); System.out.println("New thread generated"); } } public void paint(Graphics g) { super.paint(g); for (Packets Packet : packetList) { g.drawRect(Packet.x, Packet.y, packetHeight, packetWidth); g.drawLine(sourceLocationX, sourceLocationY + packetHeight, destLocationX, sourceLocationY + packetHeight); } } public class Packets { int x; int y; int deltaX; int deltaY; public Packets(int startx, int starty, int deltax) { this.x = startx; this.y = starty; this.deltaX = deltax / 5; } public void move() { x += deltaX; if (x &gt;= CongestionControl.destLocationX - packetWidth) { x = x - deltaX; deltaX = -deltaX; y += (packetHeight + 10); } } } } </code></pre> <p>Why only first thread is running?</p>