Finding the preferred size of an AudioProcessorEditor

I’m building a plugin host environment, which involves displaying 3rd party plugin GUIs in a smooth way.

What I’m doing boils down to the following:

  1. Calling createEditorAndMakeActive() on the AudioProcessor, storing it in a wrapper Component
  2. Adding this to a DocumentWindow using setContentOwned()

This works, but I don’t know how to find the preferred size of the new AudioProcessorEditor. If I run getBounds(), it’s just saying that it’s 10 x 10, which is presumably the minimum. How can I find the correct size for the Editor?

As a side problem, I’m finding that the AudioProcessorEditor is covering up the little resize button in the bottom-right corner of the DocumentWindow, making the window very hard to resize. I’d like to find a solution to this as well, though it wouldn’t be so important if I can solve the main problem.