-
Notifications
You must be signed in to change notification settings - Fork 32
Calculator
lcaron edited this page Jul 5, 2015
·
1 revision
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 directory src/test/java/org/mihalis/opal/calculator.
These examples are also available here :