Note that there are some explanatory texts on larger screens.

plurals
  1. USuser450775
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COOk, I tried what you said and it didn't work. But it got me thinking. After trying a whole bunch of other things (removing some calls, changing some around, etc..) I went back to do exactly what you said. I went with "revalidate();repaint();" and it worked! The only thing different is that I am not calling setSize() on it. I thought I needed to since the size of the component changed, but just having getPreferredSize() return the proper size made everything work. TL;DR: made sure the only calls I had were to revalidate(); and repaint(); didn't event need to remember the position and set it
      singulars
    2. COThanks, I will give that a shot. When you say "before repaint()" do you mean before I directly invoke repaint()? Doesn't revalidate() call repaint() eventually after it's re-laid out its components? I'm not actually calling repaint() myself after revalidate(), maybe I need to (I wasn't because I could see the screen update so I figured it was being called somewhere within repaint()).
      singulars
    3. COI would have, but the SSCCE I had developed for this question wasn't showing the issue. It would seem that because it was so small, the "race condition" didn't happen (I could never visibly see the jump). The project I have is so large I couldn't just post it so I was hoping that my description was good enough :(
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload