hallo,
Ich hab nochmal eine Problem:
Und zwar hab ich ein Button erstellt und möchte, dass er mein Fenster schließt.
Es kommt aber immer wenn der Listener aufgerufen wird eine NullPointerException.
Was ist los ??
Gruß Swoop
Ich hab nochmal eine Problem:
Und zwar hab ich ein Button erstellt und möchte, dass er mein Fenster schließt.
Es kommt aber immer wenn der Listener aufgerufen wird eine NullPointerException.
Was ist los ??
Gruß Swoop
Java:
private void createButton(String text, Button button){
button= new Button (this.shell,SWT.None);
button.setText(text);
GridData griddata = new GridData();
griddata.horizontalAlignment = SWT.CENTER;
griddata.widthHint = 80;
button.setLayoutData(griddata);
}
private void selectionListenerAbbruch() {
if (this.buttonAbbruch == null) {
createButton("Test",this.buttonAbbruch);
}
this.buttonAbbruch.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
processAbbruchButton();
}
});
}