javaeclipsespinnerefxclipse

JavaFX Spinner : "Spinner cannot be resolved to a type"


All other classes from JavaFX work fine but Spinner gives me "Spinner cannot be resolved to a type".

I also tried to import import javafx.scene.control.Spinner; but this gaves me The import javafx.scene.control.Spinner cannot be resolvedback.

My current import list which WORKS fine :

import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
import javafx.scene.image.PixelWriter;
import javafx.scene.paint.Color;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.canvas.Canvas;

Someone can help ? I also downloaded e(fx)lipse to solve it but didnt helped


Solution

  • As Arjan noted in the comments, check the precise Java version you are using - it is probably lower than 8u40 in which the Spinner was added - and update your JDK.

    As a side note: I ran into this when using Travis CI, from their issue tracker we know that at the moment the fix is to add dist: trusty to the .travis.yml file, but hopefully they update eventually.