I am having a problem with trying to display each separate object's properties (e.g. ID, Title, etc) in a jTextField.
I am able to get the output for the last object in the list, but I am unable to access the ones before it when I click on them in the GUI.
What do I need to add to the loop to be able to access all of the elements within the list/model, rather than just the last element? Below is my code, thankyou
for (int i = 0; i < list.size(); i++) {
model.addElement(list.get(i));
jTextFieldID.setText(model.get(i).getId());
jTextFieldTitle.setText(model.get(i).getTitle());
jTextFieldSubreddit.setText(model.get(i).getSubreddit());
jTextAreaSelfText.setText(model.get(i).getSelftext());
jTextFieldAuthor.setText(model.get(i).getAuthor());
jTextFieldCreated.setText(model.get(i).getCreated());
jTextFieldScore.setText(Integer.toString((model.get(i).getScore())));
}