- Code: Select all
import org.eclipse.swt.layout.GridLayout;
public class Temp extends Composite {
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
/**
* Create the composite.
* @param parent
* @param style
*/
public Temp(Composite parent, int style) {
super(parent, style);
toolkit.adapt(this);
toolkit.paintBordersFor(this);
setLayout(new GridLayout());
}
}
This is working fine for me, but the Javadoc for the FormToolKit constructor states:
/**
* Creates a toolkit that is self-sufficient (will manage its own colors).
* <p>
* Clients that call this method must call {@link #dispose()} when they
* are finished using the toolkit.
*
*/
I don't see the dispose() method getting called. Could this become a problem?