Chapter 03
Chapter 03
Chapter 03
CHAPTER#-03
Java Programming Chapter 03
What is AWT?
• AWT is stand for abstract window toolkit.
• Java AWT is an API to develop Graphical User Interface (GUI) or
windows-based application in java.
• AWT is used to develop desktop application.
• Java AWT Components is platform-dependent.
• Components are displayed according to the view of operating system.
• AWT is heavy weight.
Java Programming Chapter 03
What is AWT?
• The java.awt package provide classes and interfaces for AWT API.
• The java.awt package provides classes for AWT API such as:
1. TextField
2. Label
3. TextArea
4. RadioButton
5. CheckBox
6. Choice
7. List etc.
Java Programming Chapter 03
AWT Components
To prepare GUI application, AWT is able to provide support for the
following components.
label
Button
CheckBox
TextField
TextArea … etc
To provide the above GUI components, java.awt pachage has provided
predefined classes.
Java Programming Chapter 03
AWT Containers
• A container provides a space where a component can be located.
• A container in AWT is a component itself and it adds the capability to
add components [Button, Labels, TextField] to itself.
• Sub classes of a container are called as container. For example Panel,
Frame and window.
Java Programming Chapter 03
Java.awt.frame Class
• Frame is a container it able to manage some other GUI
Components like button, text field, scrollbar etc …
• The Frame is the container that contain title bar and
border and can have menu bars.
• To represent Frame in GUI application, JAVA has
provided a separate predefined class in the form
java.awt.frame.
• Frame is most widely used container while developing
an AWT application.
Java Programming Chapter 03
});
Java Programming Chapter 03
Java.awt.color class
• The color class is a part of Java Abstract Window Toolkit (AWT)
pachage.
• The color class creates color by using the given RGBA values
• Where RGBA stands for Red, Green, Blue,Alpha
• The value for individual component RGBA ranges from 0 255 or 0.0
to 1.0.
• The value of alpha determines the opacity of the color, where 0 or 0.0
stands fully transparent and 255 or 1.0 stands opaque.
Java Programming Chapter 03
Java.awt.Font class
• In java, Font is a class that belongs to the java.awt.Font package.
• It represents the font that are used to render the text.
• Class declaration
Public class Font implements Serializable{
---
---
}
Java Programming Chapter 03
Label()
Label(String text)
Thought of Day
هرگز تسلیم نشوید ،امروز سخت است و فردا سخت
تر ،اما پس فردا روز روشنی برای تان خواهد بود