Currently I'm pulling data out of SQL database table unfortunately one specific column contains more than one value (specifically an address). So I'm trying to .append this address data into a textArea of my program but I need to break the lines there so I figured I might try to tokenize it and .append(.nextToken + "\n") unless there is a better way to do it?
Here's some of my tryhard stuff
try {
rs = statement.executeQuery(query);
if (rs.next()) {
String addressLine = rs.getString("adres");
StringTokenizer st = new StringTokenizer(addressLine);
String token = st.nextToken();
dbNameField.setText(rs.getString("name"));
dbNazwiskoField.setText(rs.getString("surname"));
dbAgeField.setText(""+rs.getInt("age"));
rs.getInt("id");
while(st.hasMoreTokens()){
dbAddressField.append(token+ "\n");
}
}
except it doesn't seem to be working