java - How to make filerdear to read input file path from filechooser -
I do I file reader is happening, which reads a file path normally source made a Failcior , But I do not know how to add filepath to the file selector to add this file application.
Code for FileReader below
= string string builder =); {Try {brakaiara = new buffed reader (new file reader ("c: \ path.xxx")); While ((Lainkemera = Brakarakredlain ())! = NULL ({peas category Matekrkamra = Wargikrnkemerakmacr (Lainkemera); matcher Mdmetrkemera = Wargikrnsititametkemera Kmacr (Rekhakemara); the
Code select file:
Jefail choose a selector = new Jefailclosr (); Chooser.setCurrentDirectory (new java.io.File ( ".")); chooser.setDialogTitle ( "choosertitle" ); chooser.setFileSelectionMode (JFileChooser.FILES_ONLY); chooser.setAcceptAllFileFilterUsed (false); if (chooser.showOpenDialog (null) == JFileChooser.APPROVE_OPTION) {System.out.println ( "getSel ectedFile (): "+ chooser.getSelectedFile ());} Else {System.out.println (" no choice ");}}});
< / Html>
Comments
Post a Comment