//Mason Marnell
//It makes the boxes make a line across the screen starting at the top left
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JFrame;
public class Multithreading extends Thread{
private int T;
Multithreading (int g){
T = g;
}
public static void main(String[] args){
for (int i = 0; i < 200; i++) {
new Multithreading(i).start();
h = h+3;
}
}
static int h = 0;
public void run(){
int Y = h;
int X = Y;
final JOptionPane pane = new JOptionPane("Multithreading" + T);
final JDialog d = pane.createDialog((JFrame)null, "Title");
d.setLocation(X,Y);
d.setVisible(true);
}
}
Comments