2

I've bought a pro Javafx2 book and I tried to compile the first program from this book. The problem is that a few imports are underlined, as they can't be found. These are the problematic import statements:

import javafx.builders.GroupBuilder;
import javafx.builders.ImageViewBuilder;
import javafx.builders.RectangleBuilder;
import javafx.builders.SceneBuilder;
import javafx.builders.TextBuilder;
import javafx.builders.TranslateTransitionBuilder;

But these give no error:

import javafx.animation.Interpolator;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import javafx.geometry.VPos;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.Stage;
import javafx.util.Duration;

The question is if I'm doing something wrong? Do I need install something else to compile this code? Recently, I compiled a simple Hello World example and it worked fine.

bcsb1001
  • 2,834
  • 3
  • 24
  • 35
Karol.T
  • 65
  • 1
  • 9
  • I've solved it by deleting these classes and import default which eclipse's suggesting. So now the question is why it didnt worked. Book seems to be pretty fresh – Karol.T Jun 16 '16 at 18:59
  • [JavaFX builders are deprecated](http://mail.openjdk.java.net/pipermail/openjfx-dev/2013-March/006725.html). – jewelsea Jun 16 '16 at 21:12

1 Answers1

1

What javafx are you using?Maybe JavaFX 8?If yes 'javafx.builders' doesn't exist anymore.

For example 'javafx.builders.GroupBuilder' is in package enter image description here'javafx.scene.GroupBuilder' and it is @Deprecated:

GOXR3PLUS
  • 6,877
  • 9
  • 44
  • 93