JScrollPane setText method

ColKavanagh
ColKavanagh used Ask the Experts™
on
how do you use setText to add multiple additions to a Jscrollpane using a for loop.
I have
for(int i = 0; i < 10 ; i++){
     round.setText(vr.elementAt(i).toString() + "\n");
}

and the result I get is it just displays the last element of the vector vr.
why is it not displaying all the elements?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
JScrollPane merely provides a scrollable view of a component that u add to it.

Also as far as I know, there is no setText() method defined on a scroll pane. What is round instance of?

You can get more info on scrollpane from..

http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html


vemul
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Recommendation: Accept comment from vemul

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

DominicCronin
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial