-
Notifications
You must be signed in to change notification settings - Fork 944
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
Constraint matches dialog redraw fix #131
Conversation
@Override | ||
public void setVisible(boolean visible) { | ||
if (!visible) { | ||
setContentPane(new JPanel()); // force redraw on visible(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setVisible() shouldn't mess with the contentPane.
I suspect this works because it calls Container.validate() indirectly.
IIRC, there are 2 methods in Swing to fix these kinds of bugs:
repaint(); // typically with a custom paint() method this needs to be called, otherwise it's overkill
validate(); (or invalidate()?) // typically changing something invalidates the layout, and Swing wants to wait until all your changes are done before calculating the new layout. validate() is used to signal to Swing that you're done. IIRC...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, of course. I wasn't aware of invalidate()
, only of validate()
, and that didn't work. Fixed, will push ASAP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems not. Will investigate further.
c82ed7b
to
4441e69
Compare
Decided to refactor a bit (we now create a dialog each time and let the GC take care of it afterwards). I tried just about every combination of |
dear Jenkins, retest this please (just for checking the phrase is accepted and test results are correctly reported) |
I can't reproduce this issue (haven't applied the code changes yet). Might you remember a reproduce recipe? |
@oskopek This is good to merge, if we can prove that there is indeed a redraw issue currently (I can't seem to reproduce it). |
Great! I'll take a look at this on Thu. On Jan 26, 2016 2:24 PM, "Geoffrey De Smet" notifications@github.com
|
…ultiple times in a single solver run
4441e69
to
4b720cb
Compare
Cannot reproduce either. Pushed a correctly rebased commit just for fun. Some other change must have fixed it, or my updated system/JRE did. Closing. |
SwingUI Constraint matches dialog now redraws correctly when viewed multiple times in a single solver run