Showing posts with label menu. Show all posts
Showing posts with label menu. Show all posts

Wednesday, 12 March 2014

MENUS

Java's Abstract Windowing Toolkit (AWT) includes four concrete menu classes: Menu, MenuItem ,MenuBar ,CheckboxMenuItem......

MENU BARS AND MENUS


Java's Abstract Windowing Toolkit (AWT) includes four concrete menu classes: menu bars representing a group of menus that appears across the top of the window or the screen (class MenuBar); pull-down menus that pull from menu bars or from other menus (class Menu); menu items that represent menu selections (class MenuItem); and menu items that the user can turn on and off (class CheckBoxMenuItem).
                  These classes are all subclasses of MenuComponent, not subclasses of Component. Because they aren't components, they can't be placed in any container -- the way you would place buttons and lists in a container. In a graphical user interface (GUI) the only way to use these menu classes is to place a menu bar (which can contain additional menus) in a frame using the frame's setMenuBar method. Since the applet class is not a subclass of Frame, it does not inherit the setMenuBar method. 

This means you cannot simply place a menu bar in an applet.


The main advantages of using AWT menus in applets rather than using a custom pop-up-menu class are: