I want to unselect the file from JFileChooser
, when i click some button.
For example, if i click "Reset" button, the selected file from JFileChooser
will be unselect.
Here's the code of my JFileChooser
:
public void fileChoose(){
JFileChooser chooser = new JFileChooser();
chooser.showOpenDialog(null);
chooser.setCurrentDirectory(new File(System.getProperty("user","home")));
FileNameExtensionFilter filter = new FileNameExtensionFilter("jpg", "png");
File file = chooser.getSelectedFile();
String path = file.getAbsolutePath();
And here the Reset button code :
private void clearAllField(){
nik_input.setText("");
name_input.setText("");
born_input.setText("");
birth_date_input.setDate(null);
gender_input.setSelectedIndex(0);
address_input.setText("");
job_input.setText("");
Thanks.