I know where I want the line to start, and I know how long I want to line to be. I want the line to start at co-ordinate 100,100 of a panel and I want it to be 50 px long. How can I randomly angle the line each run? I was thinking something like:
Random rand = new Random(System.currentTimeMillis());
int angle = rand.nextInt % 360;
But how do I now use this to draw the line?
By passing by polar coordinates you can easily do what you want: