tisdag 8 maj 2012

Image class, compound class, event-driven programs

Lecture 11 Programming methodology. Mehran går igenom The Image class, Compound class och event-driven programs, bland annat.

The compound class allows for combining several graphics objects so they behave like one Object. You add objects to a compound (like it was a canvas) and you can treat the whole Compound as one object.

Event-driven programs
- Whens users interact with computer they generate events (e.g. moving/clicking the mouse, typing etc)
- Can respond to event by having listener for events.
                    addKeyListeners()
                    import java.awt.event.*

Asynchronously; it happens but you don't know when it happens