this is my problem : i have created a simple program to manage a library , and i want that the program displays in a text area the library in a formatted output(columns's alignment). I use a stringbuilder to set text in textArea but after many attempts i don't understand how separate fields.Many thanks :)
public String toString()
{
StringBuilder sb = new StringBuilder ( );
String format ="%s %s %s %s %s";
for ( libro l : getLibreria ( ) )
{
sb.append(String.format(format, l.getAutore(),l.getTitolo(),l.getSottoTitolo(),l.getEditore(),l.getDataEdizione() ));
sb.append("\n");
}
return sb.toString();
}