ArrayList alDifferentObjects = new ArrayList();
JTable table = new JTable();
JLabel label = new JLabel();
String string = new String();
alDifferentObjects.add(table);
alDifferentObjects.add(label);
alDifferentObjects.add(string);
But as the previous poster already said, it's strongly recommended putting different objects in the same collection
Try this
ArrayList<Object> alDifferentObjects = new ArrayList<Object>();
JTable table = new JTable();
JLabel label = new JLabel();
String string = new String();
alDifferentObjects.add(table);
alDifferentObjects.add(label);
alDifferentObjects.add(string);
The importing thing wasn't meant for you. The error he described strongly looked like he simply forgot to import it.
http://java.sun.com/javase/6/docs/api/java/util/ArrayList.html
About Object. I admit, the documentation says "E e" is the parameter. But the javadoc in Netbeans shows me it requests an Object. Also, the code I wrote works without a problem. So in this case, I simply assume he forgot to import the arraylist.