Test.java

This example when run, produces two very similar looking java applications, each which consists of a top level window, a menu, and a push button. One application is built using the Swing classes and the other is built using the AWT classes. If you also run the Explorer utility application with this java example, you will notice a considerable difference in the amount of information available from the component objects when comparing a Swing object with an AWT object.

This example highlights two areas:

  1. Show the differences in the amount of "information" within the Swing (non-peered) versus the AWT (peered, drawn by the OS) application using Explorer.
  2. Show some of the other "basic" differences between Swing and AWT such as:

    a. Swing's use of mnemonic for menu access (non-peered)
    b. AWT's menu access limited to F10 or Alt key (peered)

    a. Swing's key accelerator
    b. AWT's MenuShortcuts