0
In my java class I created a form and in it I created a button that clears all fields.
But I can’t get you to delete the selection of a list
that I have in the form, it erases the textfield and radios Button but not the list.
Note: I am not using Jlist but List. I have tried this Nomecurso.clearSelection();` but the code turns red incorrect and does not deselect the item.
NomeCurso = new List(5, false);
Nome Curso.setSize(200, 170);
NomeCurso.setLocation(480, 145);
NomeCurso.addItem("Adm");
NomeCurso.addItem("Biomedicina");
NomeCurso.addItem("Ciencia da computacao");
NomeCurso.addItem("Farmacia");
NomeCurso.addItem("Direito");
NomeCurso.addItem("Educação física");
...
getContentPane().add(NomeCurso);
getListModel(). removerAllElements(); would not work?
– Sorack
Put the list package also to have more material to make an example here
– Sorack
Add a [mcve] of your code so it is possible to analyze the problem.
– user28595
Not getListModel turned red
– Sarah
Pathname.removeAll(); You may have to give a repaint() later too
– Sorack