Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Add text to textarea

 
karlijn de winter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody, i've just started learning java programming. I am making a HTML editor, when you click on a button the HTML code (for exapmle <p> is added in the textarea. When i use:
if(e.getSource()==basis)
textarea.setText("<html><head></head><body");
the HTML source appears in the textarea, but i can't click on another button (the source of the second button i click on doesnt appear). Can i use something else than setText? (something what makes me allow to click on an unlimited number of buttons and every button adds a source code)
Thank you very much!! Grts Karlijn
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Karlijn,
How about insert method?
Regards,
Manfred.
 
karlijn de winter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic