You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Start.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package grafik2d;
  7. import java.awt.Color;
  8. import java.awt.Container;
  9. import javax.swing.JFrame;
  10. import javax.swing.OverlayLayout;
  11. import javax.swing.WindowConstants;
  12. /**
  13. * Builder Class
  14. * @author le
  15. */
  16. public class Start
  17. {
  18. public int zeitinput = 12;
  19. public Start()
  20. {
  21. JFrame frm = new JFrame();
  22. Container c = frm.getContentPane();
  23. c.setLayout(new OverlayLayout(c));
  24. c.setBackground(Color.WHITE);
  25. frm.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  26. Gerade leinwand = new Gerade(10,zeitinput);
  27. c.add(leinwand);
  28. leinwand.start();
  29. /*
  30. for (int i = 0; i < 100; i++)
  31. {
  32. double zufall = Math.random();
  33. long schlafzeit = (long)(1 + 100*zufall);
  34. Kreis leinwand = new Kreis(schlafzeit);
  35. leinwand.setOpaque(false);
  36. c.add(leinwand);
  37. leinwand.start();
  38. }
  39. */
  40. frm.setSize(600, 400);
  41. frm.setVisible(true);
  42. }
  43. /**
  44. * @param args the command line arguments
  45. */
  46. public static void main(String[] args)
  47. {
  48. new Start();
  49. }
  50. }