Jump to content

Is it possible, anyone show a demo of it?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts
Hey guys !

I am wondering is it possible for a, JTextArea to be editable in a JFrame also visible?
I mean, I have an application that will read in txt files and put the content to the TextArea, also I want it to be editable so I can save it later again.
Now my current question, with bufferedreader can I read in text files and then add them to JTextAreas, I haven't been able to do it; so asking if anyone here at C.C have done it and would like to share the knowledge !

Cheers !
Posted Image

#2
Stu_328

Stu_328

    Learning Programmer

  • Members
  • PipPipPip
  • 92 posts
Pretty sure thats possible.

Why are you having trouble putting a String in a textarea?

#3
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

Stu_328 said:

Pretty sure thats possible.

Why are you having trouble putting a String in a textarea?

Not really, I have the problem to read in textfiles and add them up in the textarea, making it simple to be edited and saved. I have the opening/saving functions ready; but not the textfile to textarea link(does not compute !)
Posted Image

#4
Stu_328

Stu_328

    Learning Programmer

  • Members
  • PipPipPip
  • 92 posts
open the text file. Read it in (as a whole or line by line) and put it in the text area using insert().

#5
Turk4n

Turk4n

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 3,847 posts

Stu_328 said:

open the text file. Read it in (as a whole or line by line) and put it in the text area using insert().

Did not work :-(
Posted Image

#6
Stu_328

Stu_328

    Learning Programmer

  • Members
  • PipPipPip
  • 92 posts
It does work, I've just done it.

textArea.insert("stuff",0);


#7
brightmatter

brightmatter

    Learning Programmer

  • Members
  • PipPipPip
  • 36 posts
are you closing your buffered reader?