Java Abstract Window Toolkit
Java AWT is known as Abstract window Toolkit is an API used in to develop windows based applications.
Awt components are platform dependent because they are displayed according to the view or screen of the operating system.
AWT is heavyweight because its components are using resources of operating system.
Java.awt package provides some classes:
Container is the component of awt that contains other components like button, textfield, label.
Types of Containers :
Window – Window is container but it does not have borders and menu. If you want to create window, you can use frame and dialog.
Frame - The Frame is the container that can contain the title bar and menu bar. It can have other components like button, text field, etc.
Panel - The Panel is the container that doesn’t contain the title bar and menu bar. It can have other components like button, text field, etc.
Dialog - Dialog is the container having border and title. We cannot create an instance of the Dialog class without an associated instance of the respective Frame class.
Program to create a button by extends Frame class
Program to create TextField by creating instance of Frame class.
In this program, we are copy the already existing file into another file, it it does not exist it will shoe an exception otherwise it will create successfully.