File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Errors in GUI program" Watch "Errors in GUI program" New topic

Errors in GUI program

Candie Duggan

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

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

Joined: Mar 28, 2009
Posts: 9
Thank you!
I agree. Here's the link:
subject: Errors in GUI program
Similar Threads
calling another swing application to run when a button is click from my swing application
Error message
Problem with cannot find symbol message
Help understanding error messages
Help with my logo