private void addAddress() { AddressDialog form = new AddressDialog(null, null, true); WindowUtility.centerForm(form); form.addPropertyChangeListener( new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(AddressDialog.ADDRESS_SAVED)) { cadastreObjectBean1.addAddress((AddressBean) evt.getNewValue()); } } }); form.setVisible(true); }
private void editAddress() { if (cadastreObjectBean1.getSelectedAddress() == null) { return; } AddressDialog form = new AddressDialog( (AddressBean) cadastreObjectBean1.getSelectedAddress().copy(), null, true); WindowUtility.centerForm(form); form.addPropertyChangeListener( new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(AddressDialog.ADDRESS_SAVED)) { cadastreObjectBean1 .getSelectedAddress() .copyFromObject((AddressBean) evt.getNewValue()); } } }); form.setVisible(true); }