I am reading a name and date in from a database, and want each to display on its own line. How can I do this, newlines and carriage returns dont seem to be recognized. This is a little bit of code to help illustrate the problem..
//Reading info from DB and putting into a String
String text="";
while(rs.next()){
text+="Name: "+rs.getString("name"+"Date: "+rs.getString("date"+"\r\n";
}
//JLabel is called label
label.setText(text);
As you can see, I am trying to get each name and date combo to fit on its own line. Any help would be greatly appriciated.
-Greg
//Reading info from DB and putting into a String
String text="";
while(rs.next()){
text+="Name: "+rs.getString("name"+"Date: "+rs.getString("date"+"\r\n";
}
//JLabel is called label
label.setText(text);
As you can see, I am trying to get each name and date combo to fit on its own line. Any help would be greatly appriciated.
-Greg