• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Get a String from a Text Area?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic