Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Dec 7th, 2012  |  syntax: None  |  size: 1.43 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }