package javaapplication1;
public class Main {
public static void main(String[] args) {
//display the table heading
System.out.print(" Multiplication Table\n");
System.out.print("------------------------------\n");
//Display the number title
System.out.print(" ");
for(int j=1;j<=9;j++)
System.out.print(" "+j);
System.out.print("\n");
//Print the body of the table
for(int i=1;i<=9;i++)
{
System.out.print(i+" | ");
for (int j=1;j<=9;j++)
{
if(i*j<10)
System.out.print(" "+i*j);
else System.out.print(" "+i*j);
}
System.out.print("\n");
}
}
}
I'm a beginner to java and I saw in the graphics I can draw a panel ad write in it
so I wanted to write the results of multiplication in the panel.
I tried to write it in a panel but the first row only is included in it not all the table
Can anyone give me a hand??