Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Working with Framehttp://improvejava.blogspot.in/                                  1
ObjectiveOn completion of this period, you would beable to know• Working with Frames              http://improvejava.blogs...
RecapIn the previous class, you have leant• Fundamentals of Windows• Frame, Panel class hierarchy                http://im...
Working with Frame• The constructors of Frame are   – Frame( )   – Frame(String title)• The first form creates a standard ...
Methods of Frame• There are several methods you will use when  working with Frame windows• Setting the Window’s Dimensions...
Methods of Frame                           contd..• Hiding and Showing a  Window  – After a frame window    has been creat...
Methods of Frame                             contd..• Setting a Window’s Title  – You can change the title in a frame wind...
Methods of Frame                             contd..• Closing a Frame Window  – The window must be removed, when closing  ...
Summary• We have learned  – The different constructors of Frame  – The methods of Frame class                 http://impro...
Quiz1. Which one is not a method of Frame class ?  a)   setVisible()  b)   setSize()  c)   setDimension()  d)   setTitle()...
Frequently Asked Questions1. List and explain the different constructors    of Frame class2. List and explain the differen...
Upcoming SlideShare
Loading in …5
×

Working with frames

523 views

Published on

  • Be the first to comment

  • Be the first to like this

Working with frames

  1. 1. Working with Framehttp://improvejava.blogspot.in/ 1
  2. 2. ObjectiveOn completion of this period, you would beable to know• Working with Frames http://improvejava.blogspot.in/ 2
  3. 3. RecapIn the previous class, you have leant• Fundamentals of Windows• Frame, Panel class hierarchy http://improvejava.blogspot.in/ 3
  4. 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. 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. 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. 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. 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. 9. Summary• We have learned – The different constructors of Frame – The methods of Frame class http://improvejava.blogspot.in/ 9
  10. 10. Quiz1. Which one is not a method of Frame class ? a) setVisible() b) setSize() c) setDimension() d) setTitle() http://improvejava.blogspot.in/ 10
  11. 11. Frequently Asked Questions1. List and explain the different constructors of Frame class2. List and explain the different methods of Frame class http://improvejava.blogspot.in/ 11

×