size
Sets the component's actual size to width by height, like setSize. A layout manager overrides this on its next layout pass, so it takes effect for components positioned by themselves - those in a null layout or a JLayeredPane. To influence a managed layout, use preferredSize, minimumSize, or maximumSize instead.
width, height, and size each read-modify-write the live size: in a modifier chain, the later call wins its axis. width(10).height(20) yields 10x20; width(10).size(20, 30) yields 20x30; size(20, 30).width(10) yields 10x30.
Return
this modifier with the size declared on it.
Parameters
the width in pixels, applied as given - minimumSize and maximumSize advise a layout manager rather than bounding a direct write.
the height in pixels, applied the same way.
See also
Sets the component's actual size to size, like setSize. See size (the Int overload) for when this takes effect and how size/width/height compose.
Return
this modifier with the size declared on it.
Parameters
the width and height in pixels. It is compared against the size applied last, so mutating the same Dimension and declaring it again resizes nothing; declare a fresh instance instead.