I am creating 9 text field in each panel. and i have to create a total of 9 panel in a applet but i have encounter a "null pointer exception" which i dun know where this error came from so i would like to ask if anyone can give any suggestion on this error Thx. i need suggestion or any form of advice on how i could slove this error thanks in advance. ____________________________________________________ CODE: for (int h = 1 ; h < 10 ; h++ ) { System.out.println(h); panel[h] = new Panel(); panel[h].setLayout(new GridLayout(0,1));
for (int v = 1; v < 10 ; v++ ) { txt[v] = new TextField(1); System.out.print(v); panel[h].add(txt[v]); }
Anyway, this isn't Swing specific - moving to Java in General (beginner)...
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus