public FirstPrimeView(Object provider) { super(); getAccessibleContext().setAccessibleName("FirstPrimeView Tester"); ServiceItem item = (ServiceItem) provider; if (item.service instanceof FirstPrime) { FirstPrime firstPrime = (FirstPrime) item.service; model = new FirstPrimeModel(); dispatcher = new FirstPrimeDispatcher(model, this, firstPrime); createView(); model.addObserver(this); } }
public void displayResult() { Integer result = model.getResult(); resultTextField.setText(result.toString()); }