• Post Reply Bookmark Topic Watch Topic
  • New Topic

One line wrong on this program: constructor is undefined

 
Ben McMahon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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.
 
manish ghildiyal
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!