CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Nov 2002
    Location
    France
    Posts
    70

    Lightbulb Another question regarding arrays of check boxes

    I declare an 6 arrays of JCheckBox each has 6 elements
    JCheckBox[] pre = new JCheckBox[6];
    JCheckBox[] expr = new JCheckBox[6];
    JCheckBox[] mot = new JCheckBox[6];
    JCheckBox[] res = new JCheckBox[6];
    JCheckBox[] dyn = new JCheckBox[6];
    JCheckBox[] appr = new JCheckBox[6];
    I am tying to use a FOR loop to fill the setText property
    Code:
      for (int i=0 ; i<6 ; i++){
           pre[i].setText(""+i);----------<< error pointing to this line
           expr[i].setText(""+i);
           mot[i].setText(""+i);
           res[i].setText(""+i);
           dyn[i].setText(""+i);
           appr[i].setText(""+i);
    
         }
    And I am getting this errors could u please explain to me why this is happennig note that it compiles ok my checkboxes are in a 2nd frame so when i click my button to show the frame where the checkboxes are it shows me this:
    Errors
    java.lang.NullPointerException
    at ccld_final.pnCcld.jbInit(pnCcld.java:109)
    Last edited by sam_ccld; December 20th, 2002 at 12:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured