Reputation: 101
So what this program is supposed to do is the user inputs a name into a text box and then presses a button to add it into an array which is displayed onto a text area. The thing is that I can't figure out how to take away a name from the arraylist randomly. I am a noob programmer.
Here is what I have so far.
Random r = new Random();
ArrayList <String> names = new ArrayList<String>();
private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {
names.add(txtAdd.getText());
txtDisplay.setText("" + names);
}
Upvotes: 3
Views: 483