Advertisement
MnMWizard

Module 10 mulit

May 12th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. //Mason Marnell
  2. //It makes the boxes make a line across the screen starting at the top left
  3.  
  4. import javax.swing.JDialog;
  5. import javax.swing.JOptionPane;
  6. import javax.swing.JFrame;
  7.  
  8. public class Multithreading extends Thread{
  9.     private int T;
  10.    
  11.     Multithreading (int g){
  12.         T = g;
  13.     }
  14.     public static void main(String[] args){
  15.         for (int i = 0; i < 200; i++) {
  16.             new Multithreading(i).start();
  17.             h = h+3;
  18.         }
  19.     }
  20.     static int h = 0;
  21.     public void run(){
  22.        
  23.         int Y = h;
  24.         int X = Y;
  25.         final JOptionPane pane = new JOptionPane("Multithreading" + T);
  26.         final JDialog d = pane.createDialog((JFrame)null, "Title");
  27.         d.setLocation(X,Y);
  28.         d.setVisible(true);
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement