Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Frame's addNotify()

 
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?
 
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.
 
Hot dog! An advertiser loves us THIS much:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic