There is an article in the tutorial about ‘component rendering’ ( There is an example where a class inherits from the ‘Panel’ class an then implements the functions ‘paint(g)’, ‘update(g)’ and ‘paintOnTop(g)’. I tried to find this functions in the API documentation to find out what type of class ‘g’ is. But I can’t find it there. What am I missing?

1 answer

Staff February 1, 2016

g is 2D HTML Canvas context that is adjusted to the given component. Adjusted means default font, color is set, clipping area is set according to the component size, the coordinates origin points to top left corner of the component. To overview methods the 2d context has, take look at the MDN documentation:  


Please login or Register to Submit Answer