JFormattedTextField array

Hi all,

I have this piece of code that runs into a runtime exception error when trying to access an element of its array.

code snippet

.....

boolean booln =true;

private JFormattedTextField [] formFields ={farm_noFld, block_noFld........};

for (int i = 0; i < formFields.length; i++)

{

System.out.println("length: " + formFields.length);

System.out.println("index[0] : " + formFields);

formFields[i].setEnabled(booln);

}

.....

Output from the program..

length: 27

index[0] : null

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

The array is created and has a size of 27 objects but I cant seen to access them...Can anyone help?

[1082 byte] By [.neogeo.a] at [2007-10-3 10:51:47]
# 1
> The array is created post this part[edit]actually, the part that creates the objects that are added to the arrayMessage was edited by: Michael_Dunn
Michael_Dunna at 2007-7-15 6:17:10 > top of Java-index,Desktop,Core GUI APIs...
# 2
See reply 2 of this posting: http://forum.java.sun.com/thread.jspa?threadID=788551Why do you have to be asked every time?
camickra at 2007-7-15 6:17:10 > top of Java-index,Desktop,Core GUI APIs...