SlideShare uma empresa Scribd logo
1 de 14
Fundamentals of Windows




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

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

• Fundamentals of Windows




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

In the previous class, you have leant

• Using delegation event model
   • Handling keyboard events
   • Handling Mouse events
   • Adapter class




                  http://improvejava.blogspot.in/
                                                    3
Fundamentals of Windows
• The AWT defines windows according to a class
  hierarchy that adds functionality and specificity with each
  level
• The two most common windows are those derived from
   – Panel
   – Frame
• Much of the functionality of these windows is derived
  from their parent classes
• A description of the class hierarchies relating to these
  two classes is fundamental to their understanding


                     http://improvejava.blogspot.in/
                                                                4
Fundamentals of Windows                                    contd..

 • Fig. 61-1 shows the class hierarchy for Panel and Frame

                                                      Component



                                                        Container


MenuContainerInterface
                                   Window                                 Panel



                                              Fig. 61.1 Class hierarchy of Panel and Frame
                    Frame

                            http://improvejava.blogspot.in/                                  5
                                                                                                 5
Component Class
• Component class is at the top of the AWT hierarchy
• Component is an abstract class that encapsulates all of
  the attributes of a visual component
• All GUI components are subclasses of Component
• It defines over a hundred public methods that are
  responsible for managing events
• A Component object is responsible for remembering the
  current foreground and background colors and the
  currently selected text font




                    http://improvejava.blogspot.in/     6
Container Class
• The Container class is a subclass of Component
• It has additional methods that allow other
  Component objects to be nested within it
• Other Container objects can be stored inside of
  a Container
• A container is responsible for laying out any
  components that it contains
• It does this through the use of various layout
  managers

                 http://improvejava.blogspot.in/   7
Panel Class
• The Panel class is a concrete subclass of
  Container
• It doesn’t add any new methods; it simply
  implements Container
• Panel is the superclass for Applet
• a Panel is a window that does not contain a title
  bar, menu bar, or border
• Other components can be added to a Panel
  object by its add( ) method
                  http://improvejava.blogspot.in/   8
Window Class
• The Window class creates a top-level window
• A top-level window is not contained within any
  other object
• It sits directly on the desktop




                http://improvejava.blogspot.in/   9
Frame Class
• Frame encapsulates what is commonly thought
  of as a “window”
• It is a subclass of Window
• It has
  –   A title bar
  –   Menu bar
  –   Borders
  –   Resizing corners



                    http://improvejava.blogspot.in/   10
Summary
• We have discussed
  – The fundamentals of windows
  – Frame class hierarchy




               http://improvejava.blogspot.in/   11
Quiz
1. The parent class of Frame class is
  a)   Panel
  b)   Container
  c)   Component
  d)   Window




                   http://improvejava.blogspot.in/   12
Quiz                      contd...
2. Whether Frame class has title bar ?
  a) True
  b) False




               http://improvejava.blogspot.in/              13
Frequently Asked Questions
1. Explain the fundamentals of windows
2. Draw the class hierarchy of Frame class




                 http://improvejava.blogspot.in/   14

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Introduction to the DOM
Introduction to the DOMIntroduction to the DOM
Introduction to the DOM
 
Encapsulation C++
Encapsulation C++Encapsulation C++
Encapsulation C++
 
Html frames
Html framesHtml frames
Html frames
 
Html ppt
Html pptHtml ppt
Html ppt
 
Chapter2 Encapsulation (Java)
Chapter2 Encapsulation (Java)Chapter2 Encapsulation (Java)
Chapter2 Encapsulation (Java)
 
Html frames
Html framesHtml frames
Html frames
 
Python GUI Programming
Python GUI ProgrammingPython GUI Programming
Python GUI Programming
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
Array of objects.pptx
Array of objects.pptxArray of objects.pptx
Array of objects.pptx
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Java IO
Java IOJava IO
Java IO
 
Java swing 1
Java swing 1Java swing 1
Java swing 1
 
Debugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbDebugging Modern C++ Application with Gdb
Debugging Modern C++ Application with Gdb
 
An Introduction to the DOM
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
 
java swing
java swingjava swing
java swing
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
div tag.pdf
div tag.pdfdiv tag.pdf
div tag.pdf
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 

Semelhante a Fundamentals of windows.64

Appl clas nd architect.56
Appl clas nd architect.56Appl clas nd architect.56
Appl clas nd architect.56
myrajendra
 
9awt Components
9awt Components9awt Components
9awt Components
Adil Jafri
 
Vb.net session 09
Vb.net session 09Vb.net session 09
Vb.net session 09
Niit Care
 
Working with frames
Working with framesWorking with frames
Working with frames
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
 
Java session10
Java session10Java session10
Java session10
Niit Care
 

Semelhante a Fundamentals of windows.64 (20)

Introdu.awt
Introdu.awtIntrodu.awt
Introdu.awt
 
Appl clas nd architect.56
Appl clas nd architect.56Appl clas nd architect.56
Appl clas nd architect.56
 
UNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdfUNIT-2-AJAVA.pdf
UNIT-2-AJAVA.pdf
 
9awt Components
9awt Components9awt Components
9awt Components
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
 
Vb.net session 09
Vb.net session 09Vb.net session 09
Vb.net session 09
 
Working with frames
Working with framesWorking with frames
Working with frames
 
AWT controls, Listeners
AWT controls, ListenersAWT controls, Listeners
AWT controls, Listeners
 
AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
 
The Concept of Abstract Window Took Kit In Java
The Concept of Abstract Window Took Kit In JavaThe Concept of Abstract Window Took Kit In Java
The Concept of Abstract Window Took Kit In Java
 
The Concept of Abstract Window Took Kit In Java
The Concept of Abstract Window Took Kit In JavaThe Concept of Abstract Window Took Kit In Java
The Concept of Abstract Window Took Kit In Java
 
Dacj 2-2 a
Dacj 2-2 aDacj 2-2 a
Dacj 2-2 a
 
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)
 
Java session10
Java session10Java session10
Java session10
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 
Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1Concurrency Programming in Java - 02 - Essentials of Java Part 1
Concurrency Programming in Java - 02 - Essentials of Java Part 1
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
 
What's new in Joomla 1.6?
What's new in Joomla 1.6?What's new in Joomla 1.6?
What's new in Joomla 1.6?
 
Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development Eclipse IDE, 2019.09, Java Development
Eclipse IDE, 2019.09, Java Development
 

Mais de 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
 

Fundamentals of windows.64

  • 1. Fundamentals of Windows http://improvejava.blogspot.in/ 1
  • 2. Objective On completion of this period, you would be able to know • Fundamentals of Windows http://improvejava.blogspot.in/ 2
  • 3. Recap In the previous class, you have leant • Using delegation event model • Handling keyboard events • Handling Mouse events • Adapter class http://improvejava.blogspot.in/ 3
  • 4. Fundamentals of Windows • The AWT defines windows according to a class hierarchy that adds functionality and specificity with each level • The two most common windows are those derived from – Panel – Frame • Much of the functionality of these windows is derived from their parent classes • A description of the class hierarchies relating to these two classes is fundamental to their understanding http://improvejava.blogspot.in/ 4
  • 5. Fundamentals of Windows contd.. • Fig. 61-1 shows the class hierarchy for Panel and Frame Component Container MenuContainerInterface Window Panel Fig. 61.1 Class hierarchy of Panel and Frame Frame http://improvejava.blogspot.in/ 5 5
  • 6. Component Class • Component class is at the top of the AWT hierarchy • Component is an abstract class that encapsulates all of the attributes of a visual component • All GUI components are subclasses of Component • It defines over a hundred public methods that are responsible for managing events • A Component object is responsible for remembering the current foreground and background colors and the currently selected text font http://improvejava.blogspot.in/ 6
  • 7. Container Class • The Container class is a subclass of Component • It has additional methods that allow other Component objects to be nested within it • Other Container objects can be stored inside of a Container • A container is responsible for laying out any components that it contains • It does this through the use of various layout managers http://improvejava.blogspot.in/ 7
  • 8. Panel Class • The Panel class is a concrete subclass of Container • It doesn’t add any new methods; it simply implements Container • Panel is the superclass for Applet • a Panel is a window that does not contain a title bar, menu bar, or border • Other components can be added to a Panel object by its add( ) method http://improvejava.blogspot.in/ 8
  • 9. Window Class • The Window class creates a top-level window • A top-level window is not contained within any other object • It sits directly on the desktop http://improvejava.blogspot.in/ 9
  • 10. Frame Class • Frame encapsulates what is commonly thought of as a “window” • It is a subclass of Window • It has – A title bar – Menu bar – Borders – Resizing corners http://improvejava.blogspot.in/ 10
  • 11. Summary • We have discussed – The fundamentals of windows – Frame class hierarchy http://improvejava.blogspot.in/ 11
  • 12. Quiz 1. The parent class of Frame class is a) Panel b) Container c) Component d) Window http://improvejava.blogspot.in/ 12
  • 13. Quiz contd... 2. Whether Frame class has title bar ? a) True b) False http://improvejava.blogspot.in/ 13
  • 14. Frequently Asked Questions 1. Explain the fundamentals of windows 2. Draw the class hierarchy of Frame class http://improvejava.blogspot.in/ 14