RFR: 6510914: JScrollBar.getMinimumSize() breaks the contract of JComponent.setMinimumSize() [v6]

Prasanta Sadhukhan psadhukhan at openjdk.org
Mon Nov 20 10:26:37 UTC 2023


On Fri, 17 Nov 2023 18:57:29 GMT, Phil Race <prr at openjdk.org> wrote:

> I'm not seeing anything I'd call truly bad here. But I do have another suggestion that actually might have been the best thing to do all those years ago. Keep the over-ride as the default behaviour, and document it better. But if the app calls setMaximumSize or setMinimumSize() then honour it like you are supposed to. I suspect very few apps actually call these since they are complete no-ops today. If we do that, then yes, you'll still see differences if you do call those APIs and forgot about it because it didn't make a difference.
> 
> If that isn't going to work, then, I think we should fall back to the pure documentation solution. Well, almost pure docs, but not quite, because we need a no-op over-ride of set* on which to place the docs.

Do you mean this way https://openjdk.github.io/cr/?repo=jdk&pr=15325&range=01#sdiff-0-src/java.desktop/share/classes/javax/swing/JScrollBar.java what I had done in the initial iteration? I guess that change will still show the above problem during frame resize, where scrollbars are not rigid

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15325#issuecomment-1818768822


More information about the client-libs-dev mailing list