The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
April 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


doubly -linked list

Posted by Matt Gerrans on January 21, 2002 at 10:25 PM

> I desparately need help with these topic. Currently, I am doing a project using doubly link list data structure and swing components. However, I just could not get the data items of the doubly link list to display on the JTextArea. Does anybody out there know how to solve this problem?

Could you be more specific about your problem? Maybe show some of the code in question? Also, why are you not simply using the LinkedList that comes with the Java API?

If all the objects in your existing list have a toString() (which they should, so if they don't then and one), then maybe all you need to do is iterate through the list and append() the String representation of each object to the TextArea (you could throw in a '\n' after each one, if it makes things look nicer). The List in the Java API has a toString() already, rendering the whole task even more trivial.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us