Using arrays to make textfields, problem.
Here's my problem when i run this code, it makes a string in the middle of the screen. This string contains the text of the textfield, so i think it supposed to be a textfield. Do you know why this program is doing this.
I have JDK 1.5.0_06 and JRE 1.6.
Can you help me out please, thanks in advance.
/**
* @(#)HusIP.java
*
* HusIP application
*
* @author
* @version 1.00 2007/5/17
*/
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
publicclass HusIPextends JFrame{
private JTextField[] maskrij;// array for mask fields
privatefinalint AANTAL_MASK = 4;//final for number of Mask fields
private JTextField[] iprij;// array for ip fields
privatefinalint AANTAL_IP = 5;// final for IP fields
publicstaticvoid main(String[] args){
new HusIP();
}
public HusIP(){
addWindowListener (new WindowHandler());// for the window
setSize(new Dimension (500, 500));//setting the size
setTitle("Hus Corp. IP-Calculator.");
iprij =new JTextField [AANTAL_IP];
int xpos = 0;
for (int i = 0; i <iprij.length; i++){// creating textfields in the frame
iprij[i] =new JTextField ("192", 3);//making its value 192 for id reasons
iprij[i].setBounds (xpos, 20, 30, 20);// setting bounds, making xpos so it moves 40 spaces
add(iprij[i]);
xpos+=40;//increasing xpos
}
maskrij =new JTextField [AANTAL_MASK];
int xpos1 = 0;
for (int j = 0; j >< maskrij.length; j++){// making textfields.
maskrij[j] =new JTextField ("255", 3);//making its value 255 for id reasons
maskrij[j].setBounds (xpos1, 50, 30, 20);
add(maskrij[j]);
xpos1+=40;//increasing xpos1
}
setVisible(true);//so you can see frame
}
privateclass WindowHandlerextends WindowAdapter{//closing window
publicvoid windowClosing (WindowEvent e){
dispose();
System.exit(0);
}
}
}

