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

Displaying a file contents in TextArea of a GUI

 
Ahmed Mohamed
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,
can any one direct me in how to display the contents of a file in a textArea of a GUI.....for example

the program should read a paragraph from a file ...this paragraph should be displayed in the TextArea in the GUI which is designed previously....how do i do that...?

THANKS
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after you've read in/separated the part of the file you want
textArea.setText([paragraph]);

or, if you want to add it after the current text in the text area
textArea.append([paragraph]);
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic