This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes cannot find symbol 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 "cannot find symbol" Watch "cannot find symbol" New topic
Author

cannot find symbol

Megs Maquito
Ranch Hand

Joined: May 18, 2005
Posts: 84
Hello,

Pls. help

heres the error:

PayCalc.java:34: cannot find symbol
symbol : constructor JComboBox(int[])
location: class javax.swing.JComboBox
dayOfMonth = new JComboBox(days);



I'm a Hood Ornament
Dan Patterson
Greenhorn

Joined: Jan 27, 2005
Posts: 24
JComboBox does not have a constructor that takes an array of ints.

Constructor Summary
JComboBox()
Creates a JComboBox with a default data model.

JComboBox(ComboBoxModel aModel)
Creates a JComboBox that takes it's items from an existing ComboBoxModel.

ComboBox(Object[] items)
Creates a JComboBox that contains the elements in the specified array.

JComboBox(Vector<?> items)
Creates a JComboBox that contains the elements in the specified Vector.

You could always change your ints to int objects.

Are you using J2SE 5.0?, if so I thought autoboxing and autounboxing would take care of this, maybe somebody can speak to this, im not sure about it.
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
Originally posted by Dan Patterson:

Are you using J2SE 5.0?, if so I thought autoboxing and autounboxing would take care of this, maybe somebody can speak to this, im not sure about it.


That's a bridge too far for autoboxing. It can do the following:

but not this:


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot find symbol
 
Similar Threads
I Seriously Need Helps.. Ugently
Need to get data to appear in JTextField..
What listener to implement for JList?
Show JPanel in another class HELP !!!!
combo box issues