Lecture 5A
  AWT Overview
  Components
  Containers
  Events
  Event Overview
  Event Example
  Event Processing
  Button Example
  Frames & Menus
  Other Components

  LayoutManagers
Lectures

1A: Introduction
1B: Java Intro
2A: BuildingBlocks
2B: Objects
3A: More Objects
3B: Exceptions
       & Threads
4A: Waves
4B: Nuclear &
       Particle
5A: AWT
5B: More AWT
      & Graphics
6A:Detectors &
      Simulation
6B: LHC/Atlas &
     RandomSims    
7A: Swing
7B: Java2D
8A: Java Apps
8B: Dialogs &
    MoreClasses
9A: Java I/O
9B: Utilities,
        Unicode
10A: More
    Threading
10B: File
    Handling
11A: Array,Print,
    Images
11B: SimplePhysics
    Simulation
12A: Tips &
    Techniques
12B: More Tips &
    Techniques
13A: Satellite
    
Simulations
13B: Intro to Java
    Networking
14A: Java Servers
14B: HTTP Server
15A: ServerClient
15B: ServerClient
   Expt.Simulation
16A: Course
          Review
16B: ExerciseTest
        Discussion

    Contacts
    Description
    Exercises
    Index
    Outline
    Q&A
    Resources
    StudentInfoForm
    Student Pages
    What's New

 

Home : Lectures : Lecture 5A : Event Handling Overview
Event Handling Overview

The user interface events must be fed to the Java AWT system from the host window.

Java has Peer class objects (more about these later) in native code for each component in the AWT. When a peer receives an event, e.g. a click on a button, it sends it to its corresponding Java AWT object.

Then the AWT in Java 1.0 sends the event to the corresponding, lowest level component, e.g. the button over which the cursor was clicked.

If that component doesn't handle the event, it goes to the container that holds it, which can then handle the event. If not, then the event moves up the containers until it is either handled or ignored.

In vers. 1.1 the AWT only sends events to those objects that implement the listener interface and have registered as listeners for the particular kind of event for that component:

 

 

Home Lectures Resources Index Contacts Students


Physics Simulations with JavaTM
KTH, Kurskod: 5A1418
Curator: Clark S. Lindsey