This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i have a window with one text field in it that accepts an int, and as soon as a user enters that int i want a window to appear with the entered amount of text fields. and as soon as the user enters the data in those text fields, my program needs to store the data in those text fields in an array or vector or something so i can access it later
i know ill have to use a for loop with the entered number and create the textfields and add them to a panel, but how do i refer to them when i dont know how many there will be?
Christophe is right. You essentially turn a List<JTextField> into a List<String> by calling getText for each of the text fields. Perhaps you can switch to using JTextField and String instead as the size never changes once created.