![]() If a MenuBar contains a help menu button, as nomiated by the use of the setHelpMenu() method, it is always presented as the right most button on the menu bar. By insisting that a top level menu in a Java artifact must be associated with a Frame instance this problem is avoided. ![]() Within the Apple, NextStep and OpenStep environments this would be particularly confusing as these environments support only a single top level menu, visible at the top of the screen, and change the options on the menu as the user moves focus from application to application. For example: when the applet is executed within a browser, the browser would supply a top level menu and if the applet were to provide a second then this would undoubtedly be confusing to a user. The reason for this restriction is that the provision of a top level menu within an applet might result in two top level menus being presented to the user. This means that application level main menus cannot be presented within a Applet window inside a browser, but only in a separate top level window on the desktop. As mentioned in Chapter 3 a Frame is not an extension of, or a parent class of, the Applet class and provides an independent top level window on the desktop. Table 6.2 Major resources of the MenuBar class.Ī MenuBar, once constructed, can only be added to a Frame instance using the Frame's setMenuBar() method. Its major resources are given in Table 6.2. The MenuBar class supplies a menu bar upon which the main menu buttons, and their pull-down menus, can be attached. Table 6.1 Major resources of the MenuComponent class. Its most important resources are given in Table 6.1. The base of the class is the abstract MenuComponent class which, like the Component class, provides a collection of resources which are common to all other MenuComponents. The MenuComponent class hierarchy diagram was given Figure 2.16 and is repeated in Figure 6.3 for convenience, again the Object class is not part of the AWT but has been included to show the relationship between the AWT classes and it.įigure 6.3 The Java AWT MenuComponent class hierarchy. ![]() The facilities for the construction of menus are supplied by the Java AWT in a class hierarchy based upon the MenuComponent class, which is a sibling class of the Component class whose hierarchy has been used so far. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |