rendered paste body//This is the error:Exception in thread "main" java.lang.NullPointerException at begin.main(begin.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)//code belowimport javax.swing.*;import java.awt.*;import java.util.Random;/** * Created by IntelliJ IDEA. * User: User * Date: 29/06/2007 * Time: 13:25:52 * To change this template use File | Settings | File Templates. */public class begin { public void particle(int x, int y){ } public static void main(String[] args){ JFrame frame = new JFrame("Fire Furry"); Graphics g = frame.getGraphics(); int particleAmount = 500; int startx = 20; int starty = 20; Color[] particleColor = new Color[particleAmount]; Color[] particleColorList = {Color.RED, Color.ORANGE, Color.WHITE}; int[] particleX = new int[particleAmount]; int[] particleY = new int[particleAmount]; int[] particleVeloX = new int[particleAmount]; int[] particleVeloY = new int[particleAmount]; //Create Random Generator Spock Styles. random random = new random(); Thread randomThread = new Thread(random); randomThread.start(); // Set random amount. random.maxRandom = 3; random.delay = 10; //ms before new number is generated. //Set Particle Starting point. for(int i = 0;i<particleAmount;i++){ particleX[i] = startx; particleY[i] = starty; } //Set Random Velocity. for(int i = 0;i<particleAmount;i++){ particleVeloX[i] = random.random - (random.maxRandom / 2); particleVeloY[i] = random.random - (random.maxRandom / 2); } //Set Random Colors. random.maxRandom = 2; for(int i = 0;i<particleAmount;i++){ particleColor[i] = particleColorList[random.random]; System.out.println(particleColor[i]); } //Set Frame Requirements (Size, Location). frame.setSize(200,200); frame.setLocation(30,30); frame.show(); //Begin main loop. random.maxRandom = 2; while(true){ //Move Particles for(int i = 0;i<particleAmount;i++){ particleX[i] = particleX[i] + particleVeloX[i]; particleY[i] = particleY[i] + particleVeloY[i]; // If particle off screen. Set new values. if(particleX[i] > frame.getWidth() || particleY[i] > frame.getHeight() || particleX[i] < 0 || particleY[i] < 0){ particleX[i] = startx; particleY[i] = starty; particleColor[i] = particleColorList[random.random]; } } //Draw particles. for(int i = 0;i<particleAmount;i++){ g.setColor(Color.RED);//particleColor[i]); g.drawLine(particleX[i],particleY[i],particleX[i],particleY[i]); frame.paintAll(g); } } }}