问题
I have a little bug to fix. You can see in the Picture 3 Months outputed.

So that is my code how I displat this result. I try String.format but I dont know how to use it at this tabs. I try it with this tabs but unfortunally I find out that the format for the first Month (January) is short then the other month. All months use 3 tabs but not the first one.
public LinkedList<String> buildMonth(int month) {
int lengthOfMonth = calender.getLengthOfMonth(this.year, month);
LinkedList<String> monthList = new LinkedList<>();
monthList.add(String.format("%-10s",monthname[month]) + String.format("%-17s", this.year));
for (int day = 1; day <= lengthOfMonth; day++) {
int daynumber = kf.daynumber(day, month, this.year);
int weekday = kf.weekday_in_year(this.year, daynumber);
//weekday give me a number where I can find out wich weekname
String monthPlan = weekdayShort[weekday] + "|" + String.format("%02d",day) +"|\t\t\t|" +String.format("%-10s",calender.getTwoDigit(daynumber));
monthList.add(monthPlan);
}
return monthList;
}
I hope anyone can help and sorry for my bad english.
Best Regard Maskulin
来源:https://stackoverflow.com/questions/44476433/define-stringformat-for-tabs