example code for graphical user interfaces lecture