Is it possible before adding a new element to the Jlist to "clear" the already made selection in the Jlist ? That would solve my problem I'm having. Because when I already have made a selection in the Jlist and then add a new element, it shows up a nullpointerexception. I do not have this problem when I add a new element without having selected something in the Jlist first. Only when I select something by means of a mouseclick, then I get an exception when adding a new elment. I also work with a defaultListmodel which contains the data of the list
EDIT: I've removed the listselectionlistener from the gui frame and it worked like a charm, is there a way to have a listselectionlistener that fills up textfields when selecting a jList Object AND have buttons that add/remove from the same jList in the same gui?