stupid question...waiting for a stupid answer
I'm wondering why I can't do the following and get my desired result:
//globals
private hasPhoneNumberChanged = false;
private void notifyChanges(boolean dirtyFlag) {
dirtyFlag = true;
setTitle("Object properties for: " + entryDN +
" ---- Unsaved Changes");
apply.setEnabled(true);
}
private class HomeOtherListener implements ActionListener {
private JDialog owner = null;
HomeOtherListener(JDialog d) {
owner = d;
}
public void actionPerformed(ActionEvent e) {
EditOtherAttributes o = new EditOtherAttributes(owner,true,
otherHomePhone);
o.setTitle("Home Number (Others)");
if (!o.showEditOtherAttributesDialog())
-----> notifyChanges(hasPhoneNumberChanged);
}
}
If I print out the value of hasPhoneNumberChanged before and after where
I call notifyChanges() the value of the boolean doesn't change. It only
changes within notifyChanges(). It seems as if a copy of the boolean
variable is being passed to notifyChanges() not a reference so that the
variable local to notifyChanges() is modified instead of my global variable.
Am I missing something? Should this work but in another form? Maybe I
should use String instead of boolean to pass by reference?
thanks
Brandon