You need to change:
if (i % 7 == 0)
{
System.out.print(calformat1 + " ");
}
to:
if (i % 7 == 6) {
System.out.println();
}
System.out.print(calformat1 + " ");
% 7 == 6
is true for i = 6, 13, 20, 27... This creates the row breaks at the right intervals for your desired layout.