Java SWT - Repainting a canvas after a resize
Question
I have a shell that contains a canvas, which in turn draws some text in its PaintListener. The problem is, when I dynamically reduce size of the shell with its setBounds method (this is going to happen every once in a while), the text doesn't get redrawn. In fact, the canvas' PaintListener doesn't get called again.
Is there a way to force repaint? I've tried calling canvas.redraw() but this does not work.
Solution
Hmm, it appears that I did not set a layout on the shell. After setting a FillLayout, it works.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow