import java.awt.HeadlessException; import javax.swing.JButton; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JTextField; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author juanperezu */ public class NewMain extends JFrame{ /** * @param args the command line arguments */ public NewMain() { setLayout(null); crea(); setVisible(true); } public void crea() { String cont=""; int d=20,h=20; for (int i=0;i<5;i++) { for (int j = 0; j < 10; j++) { cont="btn"+i; JTextField jB = new JTextField(cont); // .add(jB); jB.setName("jB"+cont); jB.setBounds(d,h,100,20); d+=100; add(jB); } h+=30; d=20; } } public static void main(String[] args) { NewMain o = new NewMain(); } }