I've got an Integer
called x; if it changes then i would like to update my table in a GUI. To listen to "x" I have tried
ChangeEvent y = new javax.swing.event.ChangeEvent(x);
and I implement javax.naming.event.ObjectChangeListener
:
class HDIManagementView extends FrameView
implements ObjectChangeListener, ActionListener, TableModelListener {
and I override the objectChanged
method to update my table. Nothing happened
public void objectChanged(javax.naming.event.NamingEvent name){
//gets which status
Object y=name.getChangeInfo();
String m=y.toString();
tableModel.setValueAt(y, 0, 0);
}`
if i change "x" then nothing changes in my table. What have I done wrong?
Second question is, x can only be called by value. i can only reach x from my database or my properties file. When database changes, x can't understand if it changes or not Even if listener listens. All i do is listen y which equals x. When x changes y doesn't understand because x is not calling by referens. What can i do?