Advertisement
Guest User

Untitled

a guest
Dec 7th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. import java.awt.BorderLayout;
  2. import java.awt.EventQueue;
  3. import java.awt.Point;
  4. import java.awt.Rectangle;
  5. import java.util.ArrayList;
  6.  
  7. import javax.swing.JFrame;
  8.  
  9.  
  10. public class LightningGUI {
  11.  
  12. private JFrame frame;
  13.  
  14. /**
  15. * Launch the application.
  16. */
  17. public static void main(String[] args) {
  18. EventQueue.invokeLater(new Runnable() {
  19. public void run() {
  20. try {
  21. LightningGUI window = new LightningGUI();
  22. window.frame.setVisible(true);
  23. } catch (Exception e) {
  24. e.printStackTrace();
  25. }
  26. }
  27. });
  28. }
  29.  
  30. /**
  31. * Create the application.
  32. */
  33. public LightningGUI() {
  34. initialize();
  35. }
  36.  
  37. /**
  38. * Initialize the contents of the frame.
  39. */
  40. private void initialize() {
  41. frame = new JFrame();
  42. frame.setBounds(new Rectangle(0, 0, 1000, 1000));
  43. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  44. frame.getContentPane().setLayout(new BorderLayout(0, 0));
  45.  
  46. Point start = new Point(250, 100);
  47. Point end = new Point(500, 800);
  48. ArrayList<Point> bolt = Lightning.buildBolt(start, end);
  49. LightningPanel lightningPoints = new LightningPanel();
  50. lightningPoints.setPoints(bolt);
  51.  
  52. frame.getContentPane().add(lightningPoints);
  53. }
  54.  
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement