Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / September 2007

Tip: Looking for answers? Try searching our database.

Input a linked list into a JTextArea

Thread view: 
kaltizer - 24 Sep 2007 12:11 GMT
I'm trying to insert a linked list into a text area.  Here is what I'm
trying with:

for(int i = 0; i < theDirectory.size(); i++) {
listArea.append(theDirectory.get(i));
}

theDirectory is a linked list of type String.

It's not working too well.  I would appreciate some pointers...
kaltizer - 24 Sep 2007 12:32 GMT
> I'm trying to insert a linked list into a text area.  Here is what I'm
> trying with:
[quoted text clipped - 7 lines]
>
> It's not working too well.  I would appreciate some pointers...

Please disregard this posting.  It works.
Roedy Green - 24 Sep 2007 20:00 GMT
>theDirectory is a linked list of type String.

Perhaps it is not.  Show us your declaration code.

It should look something like this:

import java.util.LinkedList;
...

LinkedList<String> theDirectory = new LinkedList<String>( 100  );

I would expect you would want to append some sort of separator between
the strings, e.g. '\n'\ or ' ' .

"It's not working too well.".
That is rather vague.  What is the compile or run time error message
you are getting?  What is the unexpected behaviour?

Ideally you show a tiny complete computer program that others can run
to track problems. What you are doing is like going to the doctor's
wearing a saying a hijab saying  "I'm sick. What's the matter with me?
I won't disrobe and I'm allergic to blood tests".
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.