So you pass a School as first argument instead of a ChooserListener, and null as second argument. I suspect you just want: throw new ItemNotFound (id) (Given that the id. And you're calling it using School sch = School.get("SCIM") ĭepartmentChooser DepartmentCho = new DepartmentChooser(sch,null) The ItemNotFound class only has one constructor: one that takes an int parameter: public ItemNotFound (int id) Youre trying to call that without any arguments: throw new ItemNotFound () Thats not going to work - you need to pass an argument for that parameter. It thus takes a ChooserListener as first argument, and a School as second argument. And indeed, the constructor is defined as public DepartmentChooser (ChooserListener callback, School s) That means you're not passing the right types to the DepartmentChooser constructor. When I compile I get the error: GradeAnalyzer.java:49: error: method getAverage in class GradeAnalyzer cannot be applied to given types myAnalyzer. program verification tools were used, the source code was audited, user testing and error reporting were conducted, and penetration testing of the system. Public void valueChanged (ListSelectionEvent e)ĭepartment lister = departments Ĭonstructor DepartmentChooser in class DepartmentChooser can not be applied to given types Settings.addMouseListener(mouseclicks) It shows the error arrayMethSumPer.java:18: error: incompatible types: int cannot be converted to float. tSelectionMode(ListSelectionModel.SINGLE_SELECTION) By debugging these programs, students can. String adding = new String įor (Iterator itr = x.iterator () itr.hasNext() )ĭepartments = (Department) itr.next () The Java Programming CourseMate includes: Debugging Exercises: Four error-filled programs accompany each chapter. Public DepartmentChooser (ChooserListener callback, School s) Welcome to SO, you have to explain more for others to solve your issue, Plus if you put your sample code and specify what wen wrong it will help you to get a better answers from others and helps other to have a clear view about the question. Public class DepartmentChooser extends JPanel implements ListSelectionListener * Write a description of class DepartmentChooser here. Hope you can help me as the deadline is soon. The programme contains few classes, but i've attach some of them. Now the first error is "constructor DepartmentChooser in class DepartmentChooser can not be applied to given types"Īnd the second is "Registration is not an abstract and dose not override abstract method actionPerformed" I have been asked to create a programme for my university, the programme was going well until I got 2 errors, I have been trying to fix them for a while now, I read most of the posts in here but unfortunately they did not help me.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |