I am trying to import the Color
class from javafx
, and use it in a scala class.
But when I use my class somewhere else, I get this error:
Error:(9, 50) type mismatch;
found : javafx.scene.paint.Color
required: drawingengine.Color
Here is the code:
package drawingengine
import javafx.scene.paint.Color
sealed class Pixel(x: Int, y: Int, color: Color);
I can fix it myself by changing line 3 to:
sealed class Pixel(x: Int, y: Int, color: javafx.scene.paint.Color);
But I think this is kinda ugly, so is't there a better way to use an imported class?
Also, i get this warning
imported `Color' is permanently hidden by definition of object Color in package drawingengine
import javafx.scene.paint.Color
and IntelliJ greys out the importing line as if it is not used.
I can see that others have had the same problem, but I don't see how the shown example applies to what i am doing. So what can I do about this warning?