For a concrete example of this, consider Button . The second argument here is the value of the button's label as a String . To examine it, it will need to be coerced to this class. To give a realistic example of this, consider the problem of password entry. The password should be entered into a single-line TextField .
Menus are pulldown menus only.
A menu consists of a MenuBar which holds a set of Menu objects. This creates a menubar with one item File . When this is selected a menupane with items New and Quit is displayed. Unfortunately, event handling within menus is not ideal. It has been designed to be different to Component , which I find to be a nuisance.