OOP CH 5
OOP CH 5
• Every user interface considers the following three main aspects: UI elements, Layouts, Behavior.
• The Abstract Window Toolkit (AWT) is Java's original platform-dependent windowing, graphics, and user-
interface widget toolkit.
• The AWT is part of theJava Foundation Classes (JFC) .
What is AWT? :
• The Java programming language class library provides a user interface toolkit called the Abstract Window
Toolkit, or the AWT.
•Java AWT is an API to develop GUI or window-based application in Java.
• Java AWT components are platform-dependent.
• The AWT is now part of the Java Foundation Classes (JFC) is the standard API for providing a Graphical
User Interface (GUI) for a Java program.
• The AWT classes are contained in the java.awt package. It is one of Java’s largest packages.
What is Swing? :
• Swing is a GUI widget toolkit for Java.
• It is part of Oracle's Java Foundation Classes (JFC)- is the API for providing a Graphical User Interface (GUI)
for Java programs.
• The swing components are defined in the package javax.swing. This package provides more powerful and
Mr
flexible components
• Swing is a Java foundation classes, library and it is has extension to do Abstract Window Toolkit (AWT).
• Various features of swing are:
Light Weight, Rich Controls, Borders, Easy mouseless Operation, Tooltips, Easy Scrolling, Highly
.R
Customizable,
2. AWT components are heavy weight. Swing components are light weight.
3. AWT doesn't support pluggable look and feel. Swing supports pluggable look and feel.
4. AWT provides less components than Swing. Swing provides more powerful com-
it
6. Advanced features is not available in AWT. Swing has many advanced features like JTabel, Jtabbed
pane which is not available in AWT.
7. Different looked feel feature is not supported in AWT. We can have different look and feel in Swing.
8. Using AWT, we have to implement a lot of things ourself. Swing has them built in.
•Event handling is a process of responding to events that can occur at any time during execution of a
program.
ADAPTERS :
• Adapter pattern is frequently used in modern Java frameworks.
• Adapter pattern works as a bridge between two incompatible interfaces.
oh