Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

One line wrong on this program: constructor is undefined

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am going through the Art and Science of Java book and I have gone through and typed out a program for making the stars on the canvas (mine uses just ovals). But there is one line that is not being accepted, even though the whole program looks like the example code.

This is the code I have:



The issue that I am having is in the starting init() method. The line has an issue. everything after the = sign is underlined red and saying

The constructor JSlider(double, double, double) is undefined

.

This code is basically the same as the book, yet I can't get it to run because of this line.

Any pointers for me? I know I could just keep going through the book, but I kind of want this to work.

Thanks.
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Message means what it conveys ie either there is nomethod by thia name OR you are supplying wrong arguments(either in number OR type).


Manish
 
Ben McMahon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

manish ghildiyal wrote:Message means what it conveys ie either there is nomethod by thia name OR you are supplying wrong arguments(either in number OR type).


Manish



Thanks mate, that did it. Such a simple thing.

TIL that JSliders don't accept doubles as input.

Also, FYI I had to add a line when creating the ovals to link to the getCurrentColor method correctly.

It all works. Cheers.
 
I can't beleive you just said that. Now I need to calm down with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic