How can i repaint a composite in Java (SWT)?
问题 When i press a button in my swt program, a new composite should be drawn. But the composite only displays if i resize the window. I have a composite ( compLoad ) in my gui which is assigned a new composite compHELP comHelp_ = new compHELP(compLoad, SWT.RESIZE); i have tried redraw() but nothing happens 回答1: The composite needs to be re-layouted when adding/removing controls , see Composite.layout() // uses Composite.layout(true) Composite.layout(boolean changed) Composite.layout(boolean