Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling method

 
Roberto Favaro
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. Im reading a file with a button on my application using a fileChooser. I need to use this file to parse the info stored inside. can anyone tell me how to use the file selected to call the method.Im having a problem with the type File and the type String. I need the type String but I have the type File.
Heres a snippet of code:
 
Roberto Favaro
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, thats not very clear. I wish to use the file selected by the filechooser in the method parseFile???
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Um, I think you're just looking for
 
Roberto Favaro
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks....
I changed the code to look as follows and it worked
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic