public RadioItem(final RadioGroup parent, int style, int index) { super(parent, checkStyle(style), checkIndex(parent, index)); this.parent = parent; this.button = parent.createButton(getStyle(), index); Listener listener = new Listener() { public void handleEvent(Event event) { if (event.type == SWT.Selection) handleSelection(event); else if (event.type == SWT.Dispose) handleDispose(event); } }; button.addListener(SWT.Selection, listener); addListener(SWT.Dispose, listener); parent.addItem(this, index); }