If I use the "getBounds()" method, same thing: The button is almost the header's height larger than the rotated panel. If I use two buttons, the rect is almost the size of the other rotated button, but there's still a little gap. I've attached an image of what it looks like.

What am I doing wrong/how can I get the bounds of the rotated object so the rectangle perfectly surrounds it?

When you get the rectangle that surrounds the object it will have an offset of at least 1 pixel(its the rect around the object after all). In the case of your button at 100x100 the surrounding rect is 102x102 then you rotate at 45 now the surrounding rect is 102/0.707 so its over 1 pixel becuase of the rotation. With the panel you have the shadow so a 200x200 panel is more like 220x220 draw rect before you apply rotation. There is a getvisibleRect function but i'm not sure how this applies to rotated objects.