• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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:
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic