check the following on Custom components:
http://developers.sun.com/jscreator/reference/techart/2/index.jsp#Custom%20Comp onents
Also, you can refer to the labs below since VWP and Sun Java Studio Creator are very similar.
http://developers.sun.com/learning/javaoneonline/j1labs.jsp?track=8&yr=2007