CPU scheduling

i have this project on CPU scheduling and i have no idea how to do it …

So the first algorithum is SJF(Shortest Job First)
And i am using JCreator to do the java codes. currently i am done doing the random generating of numbers…but i don’t understand how to apply SJF to it…

Hope someone has a sample source code to show and enlighten me. Thanks