Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Get a String from a Text Area?

 
mohan69
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have encountered a small problem in my coding. Iam able to opena file into a text area. Now I need to get each line (One at a time) into a Dialog box, which has a textarea/textfeild, and two buttons "Yes" and "No" which when clicked get the next line. Iam able to open the Dialog box but I don't know how to get each line into the Dialogbox. Also once the dialog box is opened Iam unable to close it. The only thing that closes the Dialogbox is completely closing the application.
Could anybody please solve my problem.
Thanx,
-Parwez
 
Bob Kerfoot
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Parwez,
I would probably use a "LineNumberReader" and the "readLine()" method which returns "a String containing the contents of the line, not including any line-termination characters, or null if the end of the stream has been reached".
Hope this helps,
Bob Kerfoot - SCJP
 
Manish Joshi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear You say that You can open up a dialog box Couldnot close it For closing you will have to write method and implement some of the listeners evnt handling interfaces please do go through JavaDocs of the packages as java.awt.event.*;
You will have to write a corresponding implemnted method for refering the close button in that write a command to hide that dialog box simple
Secondly to read One One line First cover your FileReader Object with BufferedReader object and then invoke methods like readLine();
so easily
javaexams@yahoo.com
Manish-India
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic