Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1.  
  2. public void cos(){
  3.  
  4. Thread thread = new Thread(() -> {
  5.  
  6. this.number = (int) (Math.random() * 4);
  7. this.radius = (int) (Math.random() * (getHeight() / 2));
  8. this.x = (int) (Math.random() * (getWidth() + 50));
  9. this.x1 = (int) (Math.random() * (getWidth() + 30));
  10. this.y = (int) (Math.random() * (getHeight() + 50));
  11. this.y1 = (int) (Math.random() * (getHeight() + 50));
  12.  
  13. });
  14.  
  15. thread.start();
  16.  
  17. try {
  18. thread.sleep(200);
  19. } catch (InterruptedException e) {
  20. e.printStackTrace();
  21. }
  22. removeAll();
  23. repaint();
  24. System.out.println("x: " + x + " ,y: " + y);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement