I understand that this may be impossible, but I would sure like to know if somebody has accomplished this, or have a work-around.
I have an SWT Button and am wanting to overwrite an existing JPanel's contents with just the Button being present. My current strategy is to have the SWT Button as an initial null field and then set it through a method, which will refresh the JPanel with the SWT Button.
Button ibutton = null;
The following is taken from my constructor (class extends JPanel
):
ibutton.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
switch (e.type) {
case SWT.Selection:
}
}
});
add(ibutton); //add is the usual swing assignment function
// and thus does not work.
If there is another means to acheive this, I would be more than grateful to hear what you have.