• Post Reply Bookmark Topic Watch Topic
  • New Topic

Outputting a text file to a Java GUI component

 
kay james
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway I can output a '.txt' file to a Java Component..?
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

you can read the file manually and append the content to a JTextComponent or to a JLabel. You can also use the URL of the file to add it directly to a JEditorPane.

Conan
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, there's a read method in JTextComponent.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!