import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import javax.swing.JFrame;
public class LightningGUI {
private JFrame frame;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LightningGUI window = new LightningGUI();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public LightningGUI() {
initialize();
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frame = new JFrame();
frame.setBounds(new Rectangle(0, 0, 1000, 1000));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().setLayout(new BorderLayout(0, 0));
Point start = new Point(250, 100);
Point end = new Point(500, 800);
ArrayList<Point> bolt = Lightning.buildBolt(start, end);
LightningPanel lightningPoints = new LightningPanel();
lightningPoints.setPoints(bolt);
frame.getContentPane().add(lightningPoints);
}
}