All About Class Frame in AWT in Java



A Frame is a top level window with a title and a border. A Frame also have a menu bar.The AWT send frame all mouse,keyboard and focus events that occur over it. Component class has a child called Windows and a sub class called Frame.

In summary Frame is an user defined window with title and corner.
The class structure of the class Frame is given as:


public class java.awt.Frame extends java.awt.Window implements java.awt.MenuContainer{
//possible cursor types for the setCursor() method
public final static int CROSSHAIR_CURSOR;
public final static int DEFAULT_CURSOR;
public final static int e_RESIZE_CURSOR;
public final static int HAND_CURSOR;
public final static int N_RESIZE_CURSOR;
public final static int MOVE_CURSOR;
public final static int TEXT_CURSOR;
public final static int WAIT_CURSOR;
public final static int NE_RESIZE_CURSOR;
public final static int NW_RESIZE_CURSOR;
public final static int S_RESIZE_CURSOR;
public final static int SE_RESIZE_CURSOR;
public final static int SW_RESIZE_CURSOR;
public final static int W_RESIZE_CURSOR;
public Frame();//default constructor. creates a new invisible frame and with no title.
public Frame(String title);//constructs a new invisible frame object with the title passed in the argument.
//methods
public void addNotify();
public void dispose();
public void remove(MenuComponent comp);
public void setCursor(int cursorType);
public void setIconImage(Image img);
public void setMenuBar(MenuBar mb);
public void setResizable(boolean resizable);
public void setTitle(String title);
public int getCursorType();
public String getTitle();
public String paramString();
public Image getIconImage();
public MenuBar getMenuBar();
public boolean isResizable(); 
 
All About Class Frame in AWT in Java All About Class Frame in AWT in Java Reviewed by Animesh Chatterjee on October 26, 2018 Rating: 5

No comments:

Powered by Blogger.