Guys I need help finding out a few methods! I tried looking but I cant seem to find them!

I need to know is how to print out 6 random numbers in a row!

So for example I need to make it look like this but i need it to print random numbers:
1 2 3 4 5 6
4 5 6 6 5 4
7 8 9 3 5 7
7 8 9 3 7 7
7 8 9 3 7 7
7 8 9 3 7 7


Also I need to know is the methods to tell if the numbers match
- Vertically
- Horizontally
- Diagonally

From there on I can develop it! Is anyone out there that can help? Please if you help me with this use really simple java programming language because I am just in grade 10!

BTW I use Dr.Java

Thanks!