java - Notify when source is updated -
i have 2 cells in sheet in java program (a kind of excel program) , want make method repeat everytime these cells updated.
more specifically, every time user changes cells on sheet have repeat method import information of cells list. need repeat method automatically x times, depending on cells behavior.
any ideas how this?
add listener (for jtextfeild documentlistener) text field(or whatever cell is), automatically created you.
// listen changes in text textfield.getdocument().adddocumentlistener(new documentlistener() {   public void changedcell(documentevent e) {     update();   }   public void removecell(documentevent e) {     update();   }   public void addcell(documentevent e) {     update();   }    public void update() {      if (integer.parseint(textfield.gettext())<=0){        // update       }   } }); 
Comments
Post a Comment