Create multiple objects from user input : <p>I'm trying to create multiple objects from user input from a Jframe form. I've seen many posts on here on how to do this with the console, which all the answers end up being put in a loop; however none asking how to do this from a Jframe form.</p>

<p><a href="https://i.stack.imgur.com/wg0vP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wg0vP.png" alt="My form"></a></p>

<pre><code>    private void CreateAccount() {
    String selected = UserSelectList.getSelectedValue();
    String setName = nameTboxSet.getText();
    String setType = UserTypeBoxSet.toString();            

    if ("user1" == selected) {user1.setName(setName); user1.setUserType(setType);}
    else if ("user2" == selected) {user2.setName(setName); user2.setUserType(setType);}
    else if ("user3" == selected) {user3.setName(setName); user3.setUserType(setType);}
    else if ("user4" == selected) {user4.setName(setName); user4.setUserType(setType);}
    else if ("user5" == selected) {user5.setName(setName); user5.setUserType(setType);}
    else if ("user6" == selected) {user6.setName(setName); user6.setUserType(setType);}
    else if ("user7" == selected) {user7.setName(setName); user7.setUserType(setType);}
    else if ("user8" == selected) {user8.setName(setName); user8.setUserType(setType);}
    else if ("user9" == selected) {user9.setName(setName); user9.setUserType(setType);}
    else if ("user10" == selected) {user10.setName(setName); user10.setUserType(setType);}
}
</code></pre>

<p>Above is what I have currently come up with, however honestly i dont think a list is necessary, i've tried many things to try and figure out how to get this work.</p>
