All About Class Menu in AWT in Java


The menu in AWT in Java

The menu in AWT in Java:

A menu is a pull-down component of a Menu bar. A menu can optionally be a tear-off menu. A tear-off menu can remain on the screen after the mouse button has been released. The mechanism for tearing off a menu is platform dependent. Each Menu must have a label that appear in the MenuBar. Menu belongs to the MenuItem class. This can be an instance of MenuItem,a sub menu(an instance of Menu) or a checkbox(an instance of CheckboxMenuItem). The class structure is given as:

public class java.awt.Menu extends 
             java.awt.MenuItem implements
             java.awt.MenuContainer{
//constructor
public Menu();
public Menu(String label);
public Menu(String label,boolean tearoff);
//methods:
public synchronized MenuItem add(MenuItem menu);
public void add(String label);
public void addNotify();
public void addSeparator();
public int countItems();
public int getItemCount();
public synchronized void insert(MenuItem menuItem,int index);
public void insert(String label,int index);
public void insertSeparator(int index);
public MenuItem getItem(int index);
public boolean isTearoff();
public String paramString();
public synchronized void remove(int index);
public synchronized void remove(MenuComponent item);
public synchronized void removeAll();
public void removeNotify();
}
 
All About Class Menu in AWT in Java All About Class Menu in AWT in Java Reviewed by Animesh Chatterjee on December 17, 2018 Rating: 5

No comments:

Powered by Blogger.