java - How to make some Action dependent on another Action's finish? -
action pasteaction = new defaulteditorkit.pasteaction(); jpopupmenu popmenu = new jpopupmenu(); menuitem = new jmenuitem(); menuitem.addactionlistener(pasteaction); menuitem.addactionlistener(searchaction); menuitem.settext("paste & search");
popmenu
menu shown up; on mouse right click on jtextfield
pasteaction
ready made.
searchaction
has code check if jtextfield
empty or not. if not empty, search...
the problem - think - pasteaction
, searchaction
invoked simultaneously. searchaction
invoked no matter pasteaction
has finished job. when searchaction
invoked check jtextfield
content; founds empty!
how make searchaction
dependent on pasteaction
's finish?
one option make generic action implementation takes in list of actions take in serial. loop on list, calling 1 @ time. use new implementation , add action listener.
@admin
ReplyDeleteOur doctors or dentists are to facilitate their advance techniques and educational experience, which provide patients with the best alternatives for oral health. Our team and dentists maintain to prepare themselves to provide maximum satisfaction for patients.
Regards,
Dentist In New Britain, CT