SlideShare a Scribd company logo
1 of 11
Working with Frame




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

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

• Working with Frames




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

In the previous class, you have leant
• Fundamentals of Windows
• Frame, Panel class hierarchy




                http://improvejava.blogspot.in/
                                                  3
Working with Frame

• The constructors of Frame are
   – Frame( )
   – Frame(String title)
• The first form creates a standard window that
  does not contain a title
• The second form creates a window with the title
  specified by title



                 http://improvejava.blogspot.in/    4
Methods of Frame

• There are several methods you will use when
  working with Frame windows
• Setting the Window’s Dimensions
  – The setSize( ) method is used to set the dimensions
    of the window
• Its signature is shown here
  – void setSize(int newWidth, int newHeight)
  – void setSize(Dimension newSize)



                   http://improvejava.blogspot.in/        5
Methods of Frame                           contd..
• Hiding and Showing a
  Window
  – After a frame window
    has been created, it will
    not be visible until you
    call
  – setVisible( )
  – Its signature is shown
    here
     • void setVisible(boolean
       visibleFlag)
     • The component is
       visible if the argument to
       this method is true
                         http://improvejava.blogspot.in/   6
Methods of Frame                             contd..


• Setting a Window’s Title
  – You can change the title in a frame window
    using setTitle( )
  – It’s general form
     • void setTitle(String newTitle)
     • Here, newTitle is the new title for the window




                   http://improvejava.blogspot.in/             7
Methods of Frame                             contd..


• Closing a Frame Window
  – The window must be removed, when closing
    the window
    • Window is removed by calling setVisible(false)
  – To close the Frame you must implement the
    windowClosing( ) method of the
    WindowListener interface
  – Inside windowClosing( ), you must remove the
    window from the screen

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

• We have learned
  – The different constructors of Frame
  – The methods of Frame class




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

1. Which one is not a method of Frame class ?
  a)   setVisible()
  b)   setSize()
  c)   setDimension()
  d)   setTitle()




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

1. List and explain the different constructors
    of Frame class

2. List and explain the different methods of Frame class




                      http://improvejava.blogspot.in/      11

More Related Content

Similar to Working with frames

The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84Mahmoud Samir Fayed
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationBattle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationRachel Cherry
 
Lesson12 other behavioural patterns
Lesson12 other behavioural patternsLesson12 other behavioural patterns
Lesson12 other behavioural patternsOktJona
 
Auto Layout Under Control @ Pragma conference 2013
Auto Layout Under Control @ Pragma conference 2013Auto Layout Under Control @ Pragma conference 2013
Auto Layout Under Control @ Pragma conference 2013Giuseppe Arici
 
C#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course ContentC#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course ContentSVRTechnologies
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesAndy Wallace
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesChris Davenport
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Developmentpanagenda
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patternsamitarcade
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep diveRomain Jarraud
 
Top 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed AnswersTop 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed AnswersWhizlabs
 
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Browser Internals for JS Devs: WebU Toronto 2016 by Alex BlomBrowser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Browser Internals for JS Devs: WebU Toronto 2016 by Alex BlomAlex Blom
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016David Brattoli
 
9awt Components
9awt Components9awt Components
9awt ComponentsAdil Jafri
 

Similar to Working with frames (20)

The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196The Ring programming language version 1.7 book - Part 78 of 196
The Ring programming language version 1.7 book - Part 78 of 196
 
The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84The Ring programming language version 1.2 book - Part 53 of 84
The Ring programming language version 1.2 book - Part 53 of 84
 
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. FoundationBattle of the Front-End Frameworks: Bootstrap vs. Foundation
Battle of the Front-End Frameworks: Bootstrap vs. Foundation
 
Lesson12 other behavioural patterns
Lesson12 other behavioural patternsLesson12 other behavioural patterns
Lesson12 other behavioural patterns
 
Auto Layout Under Control @ Pragma conference 2013
Auto Layout Under Control @ Pragma conference 2013Auto Layout Under Control @ Pragma conference 2013
Auto Layout Under Control @ Pragma conference 2013
 
C#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course ContentC#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course Content
 
9 cm604.75
9 cm604.759 cm604.75
9 cm604.75
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
Joomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic TemplatesJoomla Day UK 2009 Basic Templates
Joomla Day UK 2009 Basic Templates
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Interactive Web Design 5 - Week 2 - Introduction
Interactive Web Design 5 - Week 2 -  IntroductionInteractive Web Design 5 - Week 2 -  Introduction
Interactive Web Design 5 - Week 2 - Introduction
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Development
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patterns
 
Lec18
Lec18Lec18
Lec18
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
 
Top 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed AnswersTop 100 Java Interview Questions with Detailed Answers
Top 100 Java Interview Questions with Detailed Answers
 
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Browser Internals for JS Devs: WebU Toronto 2016 by Alex BlomBrowser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
Browser Internals for JS Devs: WebU Toronto 2016 by Alex Blom
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
9awt Components
9awt Components9awt Components
9awt Components
 
Dw cs3-introduction
Dw cs3-introductionDw cs3-introduction
Dw cs3-introduction
 

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
 

Working with frames

  • 2. Objective On completion of this period, you would be able to know • Working with Frames http://improvejava.blogspot.in/ 2
  • 3. Recap In the previous class, you have leant • Fundamentals of Windows • Frame, Panel class hierarchy http://improvejava.blogspot.in/ 3
  • 4. Working with Frame • The constructors of Frame are – Frame( ) – Frame(String title) • The first form creates a standard window that does not contain a title • The second form creates a window with the title specified by title http://improvejava.blogspot.in/ 4
  • 5. Methods of Frame • There are several methods you will use when working with Frame windows • Setting the Window’s Dimensions – The setSize( ) method is used to set the dimensions of the window • Its signature is shown here – void setSize(int newWidth, int newHeight) – void setSize(Dimension newSize) http://improvejava.blogspot.in/ 5
  • 6. Methods of Frame contd.. • Hiding and Showing a Window – After a frame window has been created, it will not be visible until you call – setVisible( ) – Its signature is shown here • void setVisible(boolean visibleFlag) • The component is visible if the argument to this method is true http://improvejava.blogspot.in/ 6
  • 7. Methods of Frame contd.. • Setting a Window’s Title – You can change the title in a frame window using setTitle( ) – It’s general form • void setTitle(String newTitle) • Here, newTitle is the new title for the window http://improvejava.blogspot.in/ 7
  • 8. Methods of Frame contd.. • Closing a Frame Window – The window must be removed, when closing the window • Window is removed by calling setVisible(false) – To close the Frame you must implement the windowClosing( ) method of the WindowListener interface – Inside windowClosing( ), you must remove the window from the screen http://improvejava.blogspot.in/ 8
  • 9. Summary • We have learned – The different constructors of Frame – The methods of Frame class http://improvejava.blogspot.in/ 9
  • 10. Quiz 1. Which one is not a method of Frame class ? a) setVisible() b) setSize() c) setDimension() d) setTitle() http://improvejava.blogspot.in/ 10
  • 11. Frequently Asked Questions 1. List and explain the different constructors of Frame class 2. List and explain the different methods of Frame class http://improvejava.blogspot.in/ 11