btnClear.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { textBox1.setText(""); textBox2.setText(""); } });