2 Replies Latest reply on Jan 8, 2008 10:40 AM by 802908

    Exception in thread "main" java.lang.NullPointerException<- please help!!!

      I am new to programming and im using eclipse.. i can't figure out what is wrong with my code and am wondering if someone could help!!!!
      import java.awt.Container;
      import java.awt.FlowLayout;
      import java.awt.GridLayout;
      import java.awt.TextField;
      import javax.swing.ButtonGroup;
      import javax.swing.JButton;
      import javax.swing.JCheckBox;
      import javax.swing.JFrame;
      import javax.swing.JLabel;
      import javax.swing.JPanel;
      import javax.swing.JTextField;
      public class LottoEvent extends JFrame {
           //setup row1
           JPanel row1 = new JPanel();
           ButtonGroup option = new ButtonGroup();
           JCheckBox quickpick = new JCheckBox("Quick pick", false);
           JCheckBox personal = new JCheckBox("Personal", true);
           //setup row2
           JPanel row2 = new JPanel();
           JLabel numbersLabel = new JLabel("Your picks: ", JLabel.RIGHT);
           JTextField[] numbers = new JTextField[6];
           JLabel winnersLabel = new JLabel("Winners: ", JLabel.RIGHT);
           JTextField[] winners = new JTextField[6];
           //setup row3
           JPanel row3 = new JPanel();
           JButton stop = new JButton("Stop");
           JButton play= new JButton("Play");
           JButton reset = new JButton("Reset");
           //setup row4
           JPanel row4 = new JPanel();
           JLabel got3Label = new JLabel("3 of 6:", JLabel.RIGHT);
           JTextField got3 = new JTextField();
           JLabel got4Label = new JLabel("4 of 6:", JLabel.RIGHT);
           JTextField got4 = new JTextField();
           JLabel got5Label = new JLabel("5 of 6:", JLabel.RIGHT);
           JTextField got5 = new JTextField();
           JLabel got6Label = new JLabel("6 of 6:", JLabel.RIGHT);
           JTextField got6 = new JTextField(10);
           JLabel drawingsLabel = new JLabel("Drawings:", JLabel.RIGHT);
           JTextField drawings = new JTextField();
           JLabel yearsLabel = new JLabel("Years:", JLabel.RIGHT);
           JTextField years = new JTextField();
           public LottoEvent() {
                //setup application name
                super("Lotto Madness");
                setSize(550, 270);
                GridLayout layout = new GridLayout(5, 1, 10, 10);
                Container pane = getContentPane();
                //layout of application
                FlowLayout layout1 = new FlowLayout(FlowLayout.CENTER, 10, 10);
                //set layout of row2
                GridLayout layout2 = new GridLayout(2, 7, 10, 10);
                for (int i = 0; i < 6; i++){
                     numbers[1]= new JTextField();
                for (int i = 0; i < 6; i++) {
                     winners[i] = new JTextField();
                //set layout of row3
                FlowLayout layout3 = new FlowLayout(FlowLayout.CENTER, 10, 10);
                GridLayout layout4 = new GridLayout(2, 3, 20, 10);
                //content of layout
           //produce layout as static void main string
      public static void main(String[] arg2){
           LottoEvent frame = new LottoEvent();