• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to read a text file using a gui  RSS feed

 
jaspreet manchinda
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers ,
I'am trying to read a text file using a gui where in when i write the name of the file or give address of it in a text box and when i click on button it should read the file but i don't exactly know how to do it
 
Tim Moores
Saloon Keeper
Posts: 3832
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two parts to it, which are really independent of one another: writing the GUI, and reading a file. Which part are you having problems with? Assuming that you're talking about a local file, note that it's much more user-friendly to select the file by using an AWT FileDialog or a Swing FileChooser, than by entering the file name.
 
jaspreet manchinda
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am having problem with reading a file suppose i have any text file in any of my directories and i want to read it
 
Tim Moores
Saloon Keeper
Posts: 3832
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by working through this tutorial: http://docs.oracle.com/javase/tutorial/essential/io/index.html, particularly "Reading, Writing, and Creating Files".
 
jaspreet manchinda
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim its working now
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!