I am trying to figure out how to request user input for the values of an array objects instance variables using jOP panes. What would I use to do this?
Here is my tester class.
import javax.swing.JOptionPane; public class StudentTester{ public static void main( String[] args ){ // create an array of student variables Student[] studArray = new Student[4]; // instantiate students using full constructor studArray[0] = new Student("Bob", "Barker", "123456", 1600); //studArray[1]setSatScore(JOptionPane.showInputDialog("Please enter a valid SAT score. Allowable range is 600 to 2400")); studArray[1] = new Student("Carol", "Cowart","234561", 1500); studArray[2] = new Student("Dan", "Smith", "345612", 1550); studArray[3] = new Student("Carl", "Newell", "456123", 1800); // instantiates objects and displays all get methods for one student object for( int i = 0; i < studArray.length; i++ ){ System.out.println( "First name " + i + " is: \n" + studArray[0].getFirstName()); System.out.println( "Last name " + i + " is: \n" + studArray[0].getLastName()); System.out.println( "ID number " + i + " is: \n" + studArray[0].getIdNumber()); System.out.println( "SAT Score " + i + " is: \n" + studArray[0].getSatScore() +"\n" ); // second loop to display toString output for( int j = 0; j < studArray.length; i++ ){ System.out.println( "The student at array index " + i + " is: \n" + studArray[i].toString() +"\n" ); } } } }