create a casual area with OpenLayers

Hi all
I use NetBeans with OpenLayers, I should create a random area, with random points to be created automatically on the map. i tried with combinations tra area,vector,vectorlayer,points but there are still successful because I can not create an array of random points for the latitude and longitude and do not know if there is a command for automatic drawing of the area. Some advice?
sorry for my english


This example might help you:

There is a polyline drawn (rectangle to be more specific) in the middle of the current view when user select “Rectangle” via context menu. Modifying e.g. dx and dy variables a bit with java.util.Random would make the vector “random”. Switching from polyline to area should be trivial.


thank you very well Matti! you have helped a lot!