On Fri, 13 Mar 2026 19:42:21 GMT, Phil Race <[email protected]> wrote:
> 5. Why specifically these methods ?
I guess requestor wanted to override the paint methods and wanted to paint the
track and thumb in own way for which he needs this values
public void paint(Graphics g, JComponent c) {
paintTrack(g, c, getTrackBounds());
Rectangle thumbBounds = getThumbBounds();
if (thumbBounds.intersects(g.getClipBounds())) {
paintThumb(g, c, thumbBounds);
}
}
> 1. It is returning an internal reference (not a copy) to the client. Dilemma
> here perhaps .. making a copy every time might be inefficient. Is there any
> impact ?
It is mentioned in the spec to not modify the return value so maybe we are
safeguarded to some extent..
<b>Warning </b>: the value returned by this method should not be
* be modified, it's a reference to the actual rectangle, not a copy.
> 6. are there other methods that other people might ask for ?
I have pinged the requestor but have not got any response..I guess since these
methods aids in overriding the paint method, these should be sufficient..
-------------
PR Comment: https://git.openjdk.org/jdk/pull/30209#issuecomment-4108565988