How can I determine the preferred size of a component immediately after creating it?
Created May 7, 2012
Scott Stanchfield Because the preferred size of a component is usually dependent on fonts and decorations used for a specific platform, you need to "realize" the component before you can ask.
To realize a component, call "addNotify()" on it. This creates the necessary peer components for it to properly determine the font sizes and any other platform details it needs.