We need to create an instance of Window class to create this container. You must use frame, dialog or another window for creating a window. The window is the container that have no borders and menu bars. There are four types of containers in Java AWT: Note: A container itself is a component (see the above diagram), therefore we can add a container inside container. Thus it contains and controls the layout of components. It is basically a screen where the where the components are placed at their specific locations. The classes that extends Container class are known as container such as Frame, Dialog and Panel. The Container is a component in AWT that can contain another components like buttons, textfields, labels etc. In order to place every component in a particular position on a screen, we need to add them to a container. In Java AWT, there are classes for each component as shown in above diagram. ComponentsĪll the elements like the button, text fields, scroll bars, etc. The hierarchy of Java AWT classes are given below. In simple words, an AWT application will look like a windows application in Windows OS whereas it will look like a Mac application in the MAC OS. The reason for this is the platforms have different view for their native components and AWT directly calls the native subroutine that creates those components. Java AWT calls the native platform calls the native platform (operating systems) subroutine for creating API components like TextField, ChechBox, button, etc.įor example, an AWT GUI with components like TextField, label and button will have different look and feel for the different platforms like Windows, MAC OS, and Unix. The AWT tutorial will help the user to understand Java GUI programming in simple and easy steps. The java.awt package provides classes for AWT API such as TextField, Label, TextArea, RadioButton, CheckBox, Choice, List etc. its components are using the resources of underlying operating system (OS). components are displayed according to the view of operating system. Java AWT components are platform-dependent i.e. Java AWT (Abstract Window Toolkit) is an API to develop Graphical User Interface (GUI) or windows-based applications in Java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |