To print to the console ( i.e. the OS window the java program is running in... ) use
Is the class you are trying to print the contents of a List ( in java.awt ) or a JList ( in javax.swing )?
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
posted 15 years ago
to print anything use: System.out.println("string1" + "string2" + variables); u can thus overload + operator to get the expression of ur desire by making any combination. u can also use System.out.print (instead of System.out.println) if u dont want to switch over to the next line after printing the stuff in the first line. to print the contents of a listbox use the following 2 methods: int countItem() this returns the total number of items in the list. and once u have the total number of items in the list u can use the following method in a loop String getItem(int) which returns the item at int position. so ur code would be something like this(if ur list is l1) int i = l1.countItem(); for(int j=0;j<i;j++)> System.out.println(l1.getItem(j));
shweta agarwal Sun Certified Programmer for the Java� 2 Platform
You didn't tell me he was so big. Unlike this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user