Results 1 to 2 of 2
  1. #1
    D.Calladine is offline Member
    Join Date
    Nov 2010
    Posts
    11
    Rep Power
    0

    Default cannot find symbol - method iterator()

    just wondering how to fix this error its driving me insane
    Java Code:
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.JFrame;
    import java.util.*;
    /**
     * Write a description of class RegHelper here.
     * 
     * @author (your name) 
     * @version (a version number or a date)
     */
    public class RegHelper extends JPanel implements ChooserListener{
    private JPanel courseChooserPanel;
    private CardLayout layout;
    private Map<String,CourseChooser> map;
    
    public RegHelper(ChooserListener listener){
    super();
    Box box = Box.createVerticalBox();
    box.add(new DeptChooser(this));
    layout = new CardLayout();
    courseChooserPanel = new JPanel(layout);
    courseChooserPanel.add(new JPanel(), "");
    map = new Hashtable<String, CourseChooser>();
    Iterator<Department> iter = Department.getCollection().Iterator();
    while(iter.hasNext()) {
    Department dept = iter.next();
    CourseChooser courseChooser = new CourseChooser(listener, dept);
    String deptcode = dept.getCode();
    courseChooserPanel.add(courseChooser, deptCode);
    map.put(deptCode,courseChooser);
    }
    box.add(courseChooserPanel);
    add(box);
    }
    
    public void tell(Object o) {
    String deptcode = ((Department) o).getCode();
    layout.show(courseChooserPanel, deptCode);
    map.get(deptCode).sayAgain();
    }
    }

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Java is case sensitive and the method is iterator, not Iterator

Similar Threads

  1. Cannot find symbol
    By Johanis in forum New To Java
    Replies: 19
    Last Post: 11-04-2010, 08:13 PM
  2. Replies: 8
    Last Post: 10-17-2010, 10:24 AM
  3. cannot find symbol
    By GabWit in forum New To Java
    Replies: 3
    Last Post: 01-25-2009, 12:13 AM
  4. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  5. Replies: 3
    Last Post: 05-01-2008, 08:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •