I understand that here I instantiate the class JFileChooser
:
JFileChooser arquivo = new JFileChooser();
I get the object from the file and call the method of class JFileChooser
(correct me if I'm wrong):
arquivo.setDialogTitle("Selecionar Arquivo");
arquivo.setFileSelectionMode(JFileChooser.FILES_ONLY);
int retorno = arquivo.showOpenDialog(this);
In the following excerpt I did not understand. I call the method getSelectedFile();
of class JFileChooser
and then play it inside a class? I've never seen this happen in php.
What happened to arquivo.getSelectedFile();
? I threw this inside where? File file is what ?? num is an incomplete class? Or is File a variable file of type File?
if(retorno == JFileChooser.APPROVE_OPTION) {
File file = arquivo.getSelectedFile();
jTextField5.setText(file.getPath());
}else {
}