Listeners
In the first guide we saw how easy it was to create 2D and 3D views. Getting them to respond to mouse events and draw something is a little more challenging but easy enough even for novice programmers.
Every view needs it's own 'listener' object and the user needs to create a class for that object. Don't panic it is easy I promise. Let's get started.

In the example sketch I created a new tab for each viewer. I strongly recommend using tabs as it helps organise your code making it easier to debug.
To create a new tab click on the small down arrow to the right of the tabs in the IDE.
I created two new tabs 'DrawLine' and 'ShowCube' for the two listeners. The steps in creating the two viewer classes are basically the same.
Next step
Now you have a choice at what to do. Experienced programmers might look at the source code and go directly to the GViewListener API guide. If you are a novice programmer or new to creating classes and objects then I recommend you continue with the next two guides which describe the creation of the viewers used in this sketch.