• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Frame's addNotify()

 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can anyone tell me what does the method addNotify()from the class Frame do? API says it makes this Frame and all its children displayable. What does it mean by displayable? What are the Frame's children?
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bob,
You asked about "displayable".
According to the Java 1.2 Specifications:

A component is displayable when it is connected to a native screen resource.
A component is made displayable either when it is added to a displayable containment hierarchy or when its containment hierarchy is made displayable. A containment hierarchy is made displayable when its ancestor window is either packed or made visible.

I think this has to do with the fact that Java components borrow their appearance/behavior from the window system of the hardware where the JVM is running. For example, say we make a Frame and add a couple of buttons to it. These buttons could be considered children of the Frame. If the program is running on a Windows system, the buttons will look like other Windows buttons. If the program is running on a Mac, the buttons will look like other Mac buttons. The code itself does not change. When we call the Frame's show() method (thus making the Frame visible), the buttons will also become visible and take on the appearance of the appropriate system.
Hope this helps.
Stephanie
 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Stephenie.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic