I have a problem with eclipse. I am trying to make a program that generate random pizza toppings Five in total. All of them are put in 4 different arrays. I try to put in a array list and then to send through a button in a JtexArea. In a console program variant i randomised the arrays and send first element with sysout. It works. Now i try to make work with a desktop GUI
package nzk.nazakthul.pizza;
import java.util.*;
public class TopinguriClass {
// Arrays
String[] salami = { "muschi", "bacon", "salam de vara", "salam de sibiu","sunca presata", "salam corizo" };
// arraylist
List<String> list = new ArrayList<String>();
}
if i put the next code after list object i get 2 errors. one says i need to have a } that closes the class and the other says that expect something after ; on the ArrayList line
for (String x:salami)
list.add(x);
am i missing something?
I have written already the code for GUI If there is a possibility to send an array directly to a text area would be ok.