aspose file tools*
The moose likes Beginning Java and the fly likes Errors in GUI program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Errors in GUI program" Watch "Errors in GUI program" New topic
Author

Errors in GUI program

Candie Duggan
Greenhorn

Joined: Mar 28, 2009
Posts: 9
I have a program for class that has 6 parts to it. I got all of them working except the GUI part. I keep getting two errors that repeat in the code. Could someone please explain what these errors mean and how can I fix them? Here is my code:


The errors on lines 247, 289, and 480 are: setMusicCD(int, MusicCD) in MusicCDInventory can not be applied to (int,CD)
The errors on lines473 and 499 are: incompatible types found : MusicCD location CD return new MusicCD(cDName, struPCNumber, genre, units, unitPrice);

Thank you in advance for any help you can give me.


Candie Duggan
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That's a mighty long method.

247/etc. is a class cast problem: I'd guess (and w/o the rest it's just a guess) that the MusicCDInventory is expecting only MusicCD parameters, whereas you're trying to pass it a CD.
Candie Duggan
Greenhorn

Joined: Mar 28, 2009
Posts: 9
David,
Thank you!
 
 
subject: Errors in GUI program