I teach Java(the class is called Computer Science but has just been Java so far) on Saturdays, and have recently had difficulty catching the 'students''(maybe it's too casual to call them that?) attention as we've been doing more object-oriented stuff(objects, instance and static properties etc.). I've not been able to make very captivating examples, because for the real use of objects to shine over spaghetti monster code requires they'd have to be pretty massive.
Anyway, last Saturday I did just a little bit on exceptions and adding jars to the classpath and then we made IRC bots(Using Pircbot, that kind of networking is a little bit much right now...). They loved it, normally they'd be content watching Youtube(it's a very informal class) while they waited for me to help them with their problems, but last Saturday they were fighting for my attention rather than me fighting for theirs. And when they went on to do their own things with the IRC bots, things I went through in previous weeks visibly clicked with them.
Maybe that was just an instance of a bad teacher becoming a less bad teacher, but I think it helps just to have fun with your students in your subject every now and then.
Have you ever started taking a class with no intentions of putting in more than minimum effort, but then been won over by the teacher/subject?