• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

cannot find symbol

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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);

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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:
 
Well THAT's new! Comfort me, reliable tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic