Your two classes are completely confused.
The answer to your original question should have been "provide an accesor method" like this:
That would however allow objects from other classes to do whatever they wish with your List.
I think the advice to make the List static was mistaken; you now have a single List which is shared between all instances of the class.
Have you sorted out the difference between paintComponent() which is used to set a display on a GUI component and System.out.print() which produces output on the command line or terminal?
I have already told you how to use methods to add to a List. In your latest example, you declare a field called list1 (bad name;
you should be more specific) and then write list in your method. That suggests you have another variable, maybe even a local variable, which you are adding to. If it is a local variable, it will vanish altogether when the method completes. Also you are adding "node" which I can't understand.
For the iteration through the List and printing out its members, use a method which prints the List out.
You ought to know how to traverse a Collection; look in the
Java Tutorial (collections->interfaces->Collection interface) for more details.
[ January 05, 2008: Message edited by: Campbell Ritchie ]