-
Notifications
You must be signed in to change notification settings - Fork 235
-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK 11 - line-wrapping JTextArea inside JScrollPane "continuously grows" #558
Comments
A workaround for now is not to use final GridBagConstraints con = new GridBagConstraints();
final GridBagLayout lay = new GridBagLayout();
p.setLayout(lay);
con.gridwidth = 1;
con.weightx = 0.0;
con.fill = GridBagConstraints.NONE;
lay.setConstraints(lbTags, con);
con.gridwidth = GridBagConstraints.REMAINDER;
con.weightx = 1.0;
con.fill = GridBagConstraints.BOTH;
lay.setConstraints(ggTags, con);
con.gridwidth = 1;
con.weightx = 0.0;
con.fill = GridBagConstraints.NONE;
lay.setConstraints(lbDescription, con);
con.gridwidth = GridBagConstraints.REMAINDER;
con.weightx = 1.0;
con.fill = GridBagConstraints.BOTH;
lay.setConstraints(ggDescription, con);
p.add(lbTags);
p.add(ggTags);
p.add(lbDescription);
p.add(ggDescription); |
Yep, we've already noticed this behavior on our internal project and already fixed it in v1.2.11. I'll double-check it tomorrow, but generally this happens because of the new tricky logic behind the "extending" scrolls bars made for the |
Also, just a side-note, it's not a JDK issue - it's a scroll pane & viewport layout issue. |
I re-checked this on current v1.2.11 code - it does seem to be fixed for default |
I'm still seeing the same behaviour, so it's not fixed. My guess is it depends a bit on actual font sizes and such, so it may be that you don't see it any longer on your system. |
I'll try it out with some different settings |
Also this behavior is not limited to |
Yes, it's not with me interacting, I just run the program, the frame opens, the component starts to grow and grow, like shown in the video link. |
I've tried that sample on a few different systems on the latest snapshot version of v1.2.11 and it works exactly the same everywhere. I tried a different |
Actually, I take it back, it seems that it doesn't work the same way on different JDK 11 versions. I've got it reproduced now, will try to find what exactly is different there. |
My JDK is 11.0.4+11-post-Debian-1deb10u1 - that's the OpenJDK package for Debian stable. Haven't tried with AdoptJDK yet. |
- AbstractTextEditorPainter.java - Fixed size issue for JDK9+
We've tracked the source of this issue - there was a single "runaway" pixel missing in text component view painting bounds that caused this particular behavior (endless expansion) in particular layout/constraints ( Take even one of the conditions mentioned above and everything would work perfectly fine even though bounds were assigned incorrectly (1px more than necessary was given to The reason that happened was addition of caret width setting in JDK 9 and change of some internal layouting happening within Fix is now out and snapshot build should be available shortly. |
Actually, snapshot version is already available. |
This occurs on JDK 11 not JDK 8, perhaps just because of different font sizes.
Demo: https://peertube.social/videos/watch/ba775afa-f349-4f93-ba15-7f098975b4ae
The text was updated successfully, but these errors were encountered: