The Artima Developer Community
Sponsored Link

Java Answers Forum
Appending data in text area

5 replies on 1 page. Most recent reply: Jun 16, 2002 9:20 PM by Charles Bell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 5 replies on 1 page
Rohit

Posts: 38
Nickname: rohit
Registered: May, 2002

Appending data in text area Posted: Jun 16, 2002 8:37 PM
Reply to this message Reply
Advertisement
Hi all,
my code is comething like this

{
//some worl
Vector v=methodCallwithReturntypeVector();
for(int i=0;i<v.size();++i){
textAreaObject.append((String)v.elementAt(i));
}

Its not displaying new text in the GUI although if I do textAreaObject.getText(), it is returning me the string with new text appeniding.

Pls help.

Rohit


Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Appending data in text area Posted: Jun 16, 2002 8:46 PM
Reply to this message Reply
I suspect that your vector v has size zero and thus is not giving you anything in your text area.
Suggest you add a line or two of debug code to see what is being returned, if anything.



Vector v=methodCallwithReturntypeVector();
textAreaObject.append("v.size() = " + String.valueOf(v.size());
System.out.println("v.size() = " + String.valueOf(v.size());
for(int i=0;i<v.size();++i){
System.out.println((String)v.elementAt(i));
textAreaObject.append((String)v.elementAt(i));
}

Rohit

Posts: 38
Nickname: rohit
Registered: May, 2002

Re: Appending data in text area Posted: Jun 16, 2002 8:49 PM
Reply to this message Reply
There are couple of items in vector , Also after the loop if I do textAreObject.getText it is giving me new string, but its not displaying it in gui.

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Appending data in text area Posted: Jun 16, 2002 8:52 PM
Reply to this message Reply
Suggest you run the command
validate with the text area or the container object which contains the textarea.

Rohit

Posts: 38
Nickname: rohit
Registered: May, 2002

Re: Appending data in text area Posted: Jun 16, 2002 8:57 PM
Reply to this message Reply
Still not working

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Appending data in text area Posted: Jun 16, 2002 9:20 PM
Reply to this message Reply
If you are not getting anything at all to show up in the textarea, then the textarea you think you are writing to must not be the one you are looking at. This might mean that you have defined the textarea more than one time in your program, perhaps once globally and another time locally, with the global version being the one you are looking at and the local (inside a method) the one you are writing to. (OR vice versa).

You should be able to write and see the result of some fool proof dummy code you can insert to test it.

Suggest you look for where the text area is declared by searching all the times it occurs in your source code. (Control-F in windows..)

Flat View: This topic has 5 replies on 1 page
Topic: Executing Servlet on J2EE Server Previous Topic   Next Topic Topic: stringTokenizer

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use