I haven’t tested, but that should be the way:
auto area = getLocalBounds().toFloat().reduced (0.5f);
float cornerSize = 10.f;
g.setColour (Colours::green);
g.fillRoundedRectangle (area, cornerSize);
g.setColour (Colours::black);
g.drawRoundedRectangle (area, cornerSize, 1.f);
see this post more details about why the 0.5 offset is needed (sometimes) Rectangles and lineThickness