// menu are "add favorite", "organize favorites", and the menu
// separator. Each iteration we remove an item, thus each time the
// list grows shorter by 1, thus we use -k (which increases with 1
// each iteration) in our getItem to compensate
JMenuItem item = qm.getItem(selection[k] + 3 - k);
SetQueryAction fqa = (SetQueryAction) item.getAction();
qm.remove(item);
File file = new File(fqa.getFileName());
file.delete();
// you also have to remove it from the list
// I'm not sure if a clean way of doing this
// but I do know that the selection index is
// ordered, thus if I just reduce it by 1