title: Find "real" height/width of Swing/AWT object
body: <p>Because Canvas3D doesn't have the ability to resize dynamically with the parent frame, I would like to be able to track when a user resizes a window and then resize it manually myself. (If this ends up crashing Canvas3D, as some docs suggest, I will simply destroy and recreate it when the user resizes their window). Part of this procedure involves being able to accurately tell how big the container panel is to begin with.</p>
  
  <p>The two methods I've tried:</p>
  
  <pre>panel.getHeight();
  panel.getPreferredSize().height;</pre>
  
  <p>Don't seem to accurately report things: <code>getHeight()</code> is invariably zero, and <code>getPreferredSize()</code> returns numbers that don't actually have anything to do with the actual size of the panel.</p>
  
  <p>Any ideas?</p>
  
  <p><b>Edit</b>: So, I took a debugger to the panel object and manually inspected the non-object properties and I didn't see anything that resembled width/height. Granted, there are sub-objects that I didn't look at. Also, maybe the window has to be visible (it isn't, at the point I'm interfacing the object) when I query for height/object?</p>
  
  <p><b>Edit 2</b>: So, Swing classes are subclasses of AWT classes, so I imagine if you're able to find the height/width of those, the approach would generalize. I've amended the title accordingly.</p>