Results 1 to 2 of 2

Thread: Error in class

  1. #1
    ai_2007 is offline Member
    Join Date
    Jun 2007
    Posts
    21
    Rep Power
    0

    Default Error in class

    I have created a class for a GUI Frame. It has functions like add, delete, edit, etc. When I compile the class there are not syntax errors. But when I try to run the class, then there is an error that says :

    NullPointerException:null

    and,

    this line of code from the class is highlighted:

    Java Code:
     field[i] = new JTextField();
    Why is this and how do I correct it?

  2. #2
    JavaBean's Avatar
    JavaBean is offline Moderator
    Join Date
    May 2007
    Posts
    1,270
    Rep Power
    9

    Default

    Let us know full code. :) and full error message which tells the line number.

    NullPointerException happens when you try to use an object reference which is null. But it is impossible to say exact reason by looking at that line ;)

Similar Threads

  1. Replies: 2
    Last Post: 09-22-2011, 10:48 PM
  2. Error: no class definition found
    By toby in forum New To Java
    Replies: 6
    Last Post: 08-28-2011, 11:32 PM
  3. cannot find symbol class error
    By po0oker in forum New To Java
    Replies: 5
    Last Post: 10-31-2007, 03:52 PM
  4. Replies: 1
    Last Post: 08-07-2007, 08:53 AM
  5. Replies: 1
    Last Post: 08-02-2007, 05:07 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
  •