2 Replies - 314 Views - Last Post: 30 April 2012 - 06:01 PM Rate Topic: -----

#1 irwin08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 04-March 12

How do i add text to a JTextArea if someone clicks a button?

Posted 30 April 2012 - 05:55 PM

hi im working on a project and cant figure out how to add text to a JTextArea when someone clicks a button in swing. Ik its kinda a stupid question but i really need help. Thx
Is This A Good Question/Topic? 0
  • +

Replies To: How do i add text to a JTextArea if someone clicks a button?

#2 nick2price  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 562
  • View blog
  • Posts: 2,826
  • Joined: 23-November 07

Re: How do i add text to a JTextArea if someone clicks a button?

Posted 30 April 2012 - 05:58 PM

In your buttons action event, use the text area's append method
textArea.append("some text");

Was This Post Helpful? 1
  • +
  • -

#3 irwin08  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 04-March 12

Re: How do i add text to a JTextArea if someone clicks a button?

Posted 30 April 2012 - 06:01 PM

It worked! thx very much!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1