I have an arraylist of city names and I want to show them as a bottom up jlabels. How can I do that?
ArrayList<String> cityNames = new ArrayList<>(columnCount);
while(resultSet.next()){
int i = 1;
while(i <= columnCount) {
cityNames.add(resultSet.getString(i++));
}
}
//Loop through cityNames as seperate Jlabels
for(String city : cityNames){
cityLabel.setText(city);
}