• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to setText(arrayName)?  RSS feed

 
Derek Rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am very new to java and have an assignment to build a sales commission program. i completed the program but am trying to add a GUI to get a head start on my next java class. i have a method Table Method, that returns an array of String data. i am trying to set the value of a text area to the values listed in the array but it wont. any suggestions?

 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


That will replace the existing text in the text area. You want to append the text to the text area:



 
Derek Rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your response. That helps with my next problem I would have had since if I understand you correctly each itterarion through the loop would write over the previous one. However I can't even get one to show up. It doesn't even erase the plaveholder default text
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to tell from the code you posted, but typically what's happening to you is caused by putting one instance of a component in the GUI and then updating a different instance of the component elsewhere in the code. As I said, from the code it's impossible to tell whether that's your problem. And we can't run the code to see what it does because you only posted a fragment. Try producing an SSCCE for us to work with.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One other thing: you have verified that the action listener is actually being called, haven't you?
 
Derek Rose
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes the compensation variable I set is writing to the text area that it is supposed to when I click "go". And sorry for the dumb question to follow but this is my first programming language and I've only been at it for two weeks. What is an SSCCE?
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is a SSCCE?


Click on the link.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!