-
Notifications
You must be signed in to change notification settings - Fork 105
Calculator
Laurent CARON edited this page Jan 10, 2026
·
2 revisions
A simple calculator, displayed as a whole widget or inside a combo.
This is very simple : you instantiate a Calculator or a CalculatorCombo, then you attach a ModifyListener in order to be informed when the value changed :
final Calculator calc = new Calculator(shell, SWT.NONE);
calc.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
System.out.println("New value is " + calc.getValue());
}
});And voilà !
2 examples called CalculatorSnippet.java and CalculatorComboSnippet.java are located in the plugin org.eclipse.nebula.widgets.opal.calculator.snippets.
These examples are also available here :