SlideShare a Scribd company logo
1 of 15
Overview of AWT Classes




    http://improvejava.blogspot.in/
                                      1
Objective

On completion of this period, you would be
able to know

• Overview of AWT Classes




              http://improvejava.blogspot.in/
                                                2
Recap

In the previous class, you have leant
• The simple applet programs




                http://improvejava.blogspot.in/
                                                  3
AWT Classes

• AWT stand for ‘Abstract Windowing Toolkit’
• The AWT classes are available in the java.awt package
• It is one of Java’s largest packages
• The main purpose of the AWT is to support applet
  windows
• It can also be used to create stand-alone windows that
  run in a GUI environment, such as Windows


                     http://improvejava.blogspot.in/
                                                           4
AWT Classes                         contd..


• The basic structure of the AWT has been the same
  since Java 1.0
• Some of the original methods were deprecated and
  replaced by new ones when Java 1.1 was released
• For backward-compatibility, Java 2 still supports all the
  original 1.0 methods
• The following tables lists the important AWT classes


                    http://improvejava.blogspot.in/         5
                                                                5
AWT Classes                        contd..
AWTEvent            Encapsulates AWT events
Button              Creates a push button control
Canvas              A blank, semantics-free window
Checkbox            Creates a check box control
CheckboxGroup       Creates a group of check box controls
CheckboxMenuItem    Creates an on/off menu item
Choice              Creates a pop-up list
                    Manages colors in a portable, platform-independent
Color
                      fashion
Component           An abstract superclass for various AWT components
                    A subclass of Component that can hold other
Container
                       components

                         http://improvejava.blogspot.in/                 6
AWT Classes                          contd..
Cursor        Encapsulates a bitmapped cursor

Dialog        Creates a dialog window

Dimension     Specifies the dimensions of an object, i.e. width and height

Event         Encapsulates events

EventQueue    Queues events

FileDialog    Creates a window from which a file can be selected

Font          Encapsulates a type font

FontMetrics   Encapsulates various information related to a font
              Creates a standard window that has a title bar, resize
Frame
                 corners, and a menu bar
Graphics      Encapsulates the graphics context. This context is
                        http://improvejava.blogspot.in/                      7
AWT Classes                       contd..
Image           Encapsulates graphical images
Insets          Encapsulates the borders of a container
Label           Creates a label that displays a string
                Creates a list from which the user can choose. Similar to
List
                   the standard Windows list box
MediaTracker    Manages media objects
Menu            Creates a pull-down menu
MenuBar         Creates a menu bar
MenuComponent   An abstract class implemented by various menu classes
MenuItem        Creates a menu item
MenuShortcut    Encapsulates a keyboard shortcut for a menu item

                        http://improvejava.blogspot.in/                     8
AWT Classes                       contd..
Panel         The simplest concrete subclass of Container
Point         Encapsulates a Cartesian coordinate pair, stored in x and y
Polygon       Encapsulates a polygon
PopupMenu     Encapsulates a pop-up menu
PrintJob      An abstract class that represents a print job
Rectangle     Encapsulates a rectangle
Scrollbar     Creates a scroll bar control
              A container that provides horizontal and/or vertical scroll bars
ScrollPane
                 for another component
              Contains the colors of GUI widgets such as windows, scroll
SystemColor
                bars, text, and others
TextField     Creates a single-line edit control

                        http://improvejava.blogspot.in/                      9
AWT Classes                          contd..

TextArea       Creates a multiline edit control

TextComponen
             A superclass for TextArea and TextField
   t

Toolkit        Abstract class implemented by the AWT

Window         Creates a window with no frame, no menu bar, and no title




                        http://improvejava.blogspot.in/                    10
Discussion
• Compare the names of Java’s AWT components with VB’s
  GUI controls

               In Java                                     In VB

   Label                                    Label

   TextField                                Textbox

   TextArea                                 Textbox

    Choice                                   ComboBox

    Button                                   CommandButton


                         http://improvejava.blogspot.in/           11
Summary

• In this class we have discussed
  – The AWT classes
  – Listed AWT classes with proper description




                http://improvejava.blogspot.in/   12
Quiz

1.Which of the following classes is not in awt
   package
  a) Button
  b) Thread
  c) Panel
  d) Menu




                  http://improvejava.blogspot.in/   13
Quiz                    contd..

2. Which of the following classes is not useful for
    user data entry
   a) TextField
   b) TextArea
   c) Label
   d) Choice




                  http://improvejava.blogspot.in/             14
Frequently Asked Questions

1. List the AWT classes that are useful for user
   data entry
2. List the AWT classes for menu processing




                 http://improvejava.blogspot.in/   15

More Related Content

What's hot

VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
Prashanth Shivakumar
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
backdoor
 

What's hot (20)

VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
Chap1 1.1
Chap1 1.1Chap1 1.1
Chap1 1.1
 
Chap1 1 1
Chap1 1 1Chap1 1 1
Chap1 1 1
 
04b swing tutorial
04b swing tutorial04b swing tutorial
04b swing tutorial
 
Java session2
Java session2Java session2
Java session2
 
L0018 - SWT - The Standard Widget Toolkit
L0018 - SWT - The Standard Widget ToolkitL0018 - SWT - The Standard Widget Toolkit
L0018 - SWT - The Standard Widget Toolkit
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
 
Java session13
Java session13Java session13
Java session13
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 
Jdbc
JdbcJdbc
Jdbc
 
swingbasics
swingbasicsswingbasics
swingbasics
 
L0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsL0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard Views
 
Introduction to java netbeans
Introduction to java netbeansIntroduction to java netbeans
Introduction to java netbeans
 
Basic of Java Netbeans
Basic of Java NetbeansBasic of Java Netbeans
Basic of Java Netbeans
 
L0020 - The Basic RCP Application
L0020 - The Basic RCP ApplicationL0020 - The Basic RCP Application
L0020 - The Basic RCP Application
 
Mobile Application Development,J2ME,UNIT-4-JNTU
Mobile Application Development,J2ME,UNIT-4-JNTUMobile Application Development,J2ME,UNIT-4-JNTU
Mobile Application Development,J2ME,UNIT-4-JNTU
 
Advanced programming ch1
Advanced programming ch1Advanced programming ch1
Advanced programming ch1
 
Android Basic
Android BasicAndroid Basic
Android Basic
 
Android
Android Android
Android
 
Microsoft visual basic 6
Microsoft visual basic 6Microsoft visual basic 6
Microsoft visual basic 6
 

Similar to Introdu.awt

Fundamentals of windows.64
Fundamentals of windows.64Fundamentals of windows.64
Fundamentals of windows.64
myrajendra
 
Chapter iii(building a simple user interface)
Chapter iii(building a simple user interface)Chapter iii(building a simple user interface)
Chapter iii(building a simple user interface)
Chhom Karath
 

Similar to Introdu.awt (20)

AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
Java AWT and Java FX
Java AWT and Java FXJava AWT and Java FX
Java AWT and Java FX
 
Java awt tutorial javatpoint
Java awt tutorial   javatpointJava awt tutorial   javatpoint
Java awt tutorial javatpoint
 
UNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdfUNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdf
 
tL19 awt
tL19 awttL19 awt
tL19 awt
 
Fundamentals of windows.64
Fundamentals of windows.64Fundamentals of windows.64
Fundamentals of windows.64
 
GUI JAVA PROG ~hmftj
GUI  JAVA PROG ~hmftjGUI  JAVA PROG ~hmftj
GUI JAVA PROG ~hmftj
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
Chapter iii(building a simple user interface)
Chapter iii(building a simple user interface)Chapter iii(building a simple user interface)
Chapter iii(building a simple user interface)
 
AWT Packages , Containers and Components
AWT Packages , Containers and ComponentsAWT Packages , Containers and Components
AWT Packages , Containers and Components
 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
 
Applet in java
Applet in javaApplet in java
Applet in java
 
object oriented programming examples
object oriented programming examplesobject oriented programming examples
object oriented programming examples
 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
 
GUI Programming In Java
GUI Programming In JavaGUI Programming In Java
GUI Programming In Java
 
Computer Programming NC III - Java Swing.pptx
Computer Programming NC III - Java Swing.pptxComputer Programming NC III - Java Swing.pptx
Computer Programming NC III - Java Swing.pptx
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
Gui programming (awt)
Gui programming (awt)Gui programming (awt)
Gui programming (awt)
 

More from myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Introdu.awt

  • 1. Overview of AWT Classes http://improvejava.blogspot.in/ 1
  • 2. Objective On completion of this period, you would be able to know • Overview of AWT Classes http://improvejava.blogspot.in/ 2
  • 3. Recap In the previous class, you have leant • The simple applet programs http://improvejava.blogspot.in/ 3
  • 4. AWT Classes • AWT stand for ‘Abstract Windowing Toolkit’ • The AWT classes are available in the java.awt package • It is one of Java’s largest packages • The main purpose of the AWT is to support applet windows • It can also be used to create stand-alone windows that run in a GUI environment, such as Windows http://improvejava.blogspot.in/ 4
  • 5. AWT Classes contd.. • The basic structure of the AWT has been the same since Java 1.0 • Some of the original methods were deprecated and replaced by new ones when Java 1.1 was released • For backward-compatibility, Java 2 still supports all the original 1.0 methods • The following tables lists the important AWT classes http://improvejava.blogspot.in/ 5 5
  • 6. AWT Classes contd.. AWTEvent Encapsulates AWT events Button Creates a push button control Canvas A blank, semantics-free window Checkbox Creates a check box control CheckboxGroup Creates a group of check box controls CheckboxMenuItem Creates an on/off menu item Choice Creates a pop-up list Manages colors in a portable, platform-independent Color fashion Component An abstract superclass for various AWT components A subclass of Component that can hold other Container components http://improvejava.blogspot.in/ 6
  • 7. AWT Classes contd.. Cursor Encapsulates a bitmapped cursor Dialog Creates a dialog window Dimension Specifies the dimensions of an object, i.e. width and height Event Encapsulates events EventQueue Queues events FileDialog Creates a window from which a file can be selected Font Encapsulates a type font FontMetrics Encapsulates various information related to a font Creates a standard window that has a title bar, resize Frame corners, and a menu bar Graphics Encapsulates the graphics context. This context is http://improvejava.blogspot.in/ 7
  • 8. AWT Classes contd.. Image Encapsulates graphical images Insets Encapsulates the borders of a container Label Creates a label that displays a string Creates a list from which the user can choose. Similar to List the standard Windows list box MediaTracker Manages media objects Menu Creates a pull-down menu MenuBar Creates a menu bar MenuComponent An abstract class implemented by various menu classes MenuItem Creates a menu item MenuShortcut Encapsulates a keyboard shortcut for a menu item http://improvejava.blogspot.in/ 8
  • 9. AWT Classes contd.. Panel The simplest concrete subclass of Container Point Encapsulates a Cartesian coordinate pair, stored in x and y Polygon Encapsulates a polygon PopupMenu Encapsulates a pop-up menu PrintJob An abstract class that represents a print job Rectangle Encapsulates a rectangle Scrollbar Creates a scroll bar control A container that provides horizontal and/or vertical scroll bars ScrollPane for another component Contains the colors of GUI widgets such as windows, scroll SystemColor bars, text, and others TextField Creates a single-line edit control http://improvejava.blogspot.in/ 9
  • 10. AWT Classes contd.. TextArea Creates a multiline edit control TextComponen A superclass for TextArea and TextField t Toolkit Abstract class implemented by the AWT Window Creates a window with no frame, no menu bar, and no title http://improvejava.blogspot.in/ 10
  • 11. Discussion • Compare the names of Java’s AWT components with VB’s GUI controls In Java In VB Label Label TextField Textbox TextArea Textbox Choice ComboBox Button CommandButton http://improvejava.blogspot.in/ 11
  • 12. Summary • In this class we have discussed – The AWT classes – Listed AWT classes with proper description http://improvejava.blogspot.in/ 12
  • 13. Quiz 1.Which of the following classes is not in awt package a) Button b) Thread c) Panel d) Menu http://improvejava.blogspot.in/ 13
  • 14. Quiz contd.. 2. Which of the following classes is not useful for user data entry a) TextField b) TextArea c) Label d) Choice http://improvejava.blogspot.in/ 14
  • 15. Frequently Asked Questions 1. List the AWT classes that are useful for user data entry 2. List the AWT classes for menu processing http://improvejava.blogspot.in/ 15