Showing posts with label add(). Show all posts
Showing posts with label add(). 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:

Monday, 3 March 2014

USING AWT CONTROLS,LAYOUT MANAGERS,AND MENUS

CONTROL FUNDAMENTALS IN JAVA

What are the different  types of AWT support  control fundamentals in java..........

The AWT supports the following types of controls:-
  • Labels
  • Push buttons
  • Check boxes
  • Choice lists
  • Lists
  • Scroll bars
  • Text editing
ADDING AND REMOVING CONTROLS:

To include a control in a window, you must add it to the window. To do this, you must first create an instance of the desired control and then add it to a window by calling add( ), which is defined by Container. 

The add( ) method has several forms


Component add(Component compObj)