How to add an image to array using JavaFX? - java

I want to add an image to an array. When I use Node it works, but when I use the same way to add images it does not appear when I run it. Here is my code:
public class PlatForm extends Application {
List<ImageView> platFormList = new ArrayList<>();
private Pane layout;
private Scene scene;
private AnimationTimer platFormTimer;
#Override
public void start(Stage primaryStage) throws Exception {
layout = new Pane();
scene = new Scene(layout,800,500);
primaryStage.setScene(scene);
primaryStage.show();
platFormTimer = new AnimationTimer() {
#Override
public void handle(long now) {
uploadPlatForm();
}
};
platFormTimer.start();
}
public void uploadPlatForm(){
for(ImageView platform : platFormList)
platform.setTranslateX(platform.getTranslateX() + Math.random() * 10);
if (Math.random() < 0.075) {
platFormList.add(newPlatForm());
}
}
private ImageView newPlatForm(){
ImageView platFormImg =
new ImageView(
new Image(getClass().getResourceAsStream("/image/platform.png")
)
);
layout.getChildren().add(platFormImg);
platFormImg.setTranslateY((int)(Math.random() * 14) * 40);
return platFormImg;
}
}

Related

3D Model does not show up in JavaFX

I'm trying to reproduce an example from this question, importing an STL file with InteractiveMesh. I've used as a model a calibration cube used in 3d printing.
This is my class code:
public class Example extends Application {
private Group root;
private PointLight pointLight;
private static final int VIEWPORT_SIZE_V1 = 720;
private static final double MODEL_SCALE_FACTOR = 400;
private static final double MODEL_X_OFFSET = 0; // standard
private static final double MODEL_Y_OFFSET = 0; // standard
private static final Color lightColor = Color.rgb(244, 255, 250);
private static final Color modelColor = Color.rgb(0, 190, 222);
private static final String MESH_FILENAME =
"/Users/user/Downloads/cube.stl";
static MeshView[] loadMeshViews(File file) {
StlMeshImporter importer = new StlMeshImporter();
try {
importer.read(file);
}
catch (ImportException e){
e.printStackTrace();
}
Mesh mesh = importer.getImport();
return new MeshView[] { new MeshView(mesh) };
}
private Group buildScene(MeshView[] meshViews) {
for (int i = 0; i < meshViews.length; i++) {
meshViews[i].setTranslateX(VIEWPORT_SIZE_V1 / 2 + MODEL_X_OFFSET);
meshViews[i].setTranslateY(VIEWPORT_SIZE_V1 / 2 + MODEL_Y_OFFSET);
meshViews[i].setTranslateZ(VIEWPORT_SIZE_V1 / 2);
meshViews[i].setScaleX(MODEL_SCALE_FACTOR);
meshViews[i].setScaleY(MODEL_SCALE_FACTOR);
meshViews[i].setScaleZ(MODEL_SCALE_FACTOR);
PhongMaterial sample = new PhongMaterial(modelColor);
sample.setSpecularColor(lightColor);
sample.setSpecularPower(16);
meshViews[i].setMaterial(sample);
meshViews[i].getTransforms().setAll(new Rotate(38, Rotate.Z_AXIS), new Rotate(20, Rotate.X_AXIS));
}
pointLight = new PointLight(lightColor);
pointLight.setTranslateX(VIEWPORT_SIZE_V1*3/4);
pointLight.setTranslateY(VIEWPORT_SIZE_V1/2);
pointLight.setTranslateZ(VIEWPORT_SIZE_V1/2);
PointLight pointLight2 = new PointLight(lightColor);
pointLight2.setTranslateX(VIEWPORT_SIZE_V1*1/4);
pointLight2.setTranslateY(VIEWPORT_SIZE_V1*3/4);
pointLight2.setTranslateZ(VIEWPORT_SIZE_V1*3/4);
PointLight pointLight3 = new PointLight(lightColor);
pointLight3.setTranslateX(VIEWPORT_SIZE_V1*5/8);
pointLight3.setTranslateY(VIEWPORT_SIZE_V1/2);
pointLight3.setTranslateZ(0);
Color ambientColor = Color.rgb(80, 80, 80, 0);
AmbientLight ambient = new AmbientLight(ambientColor);
root = new Group(meshViews);
root.getChildren().add(pointLight);
root.getChildren().add(pointLight2);
root.getChildren().add(pointLight3);
root.getChildren().add(ambient);
return root;
}
private PerspectiveCamera addCamera(Scene scene) {
PerspectiveCamera perspectiveCamera = new PerspectiveCamera();
System.out.println("Near Clip: " + perspectiveCamera.getNearClip());
System.out.println("Far Clip: " + perspectiveCamera.getFarClip());
System.out.println("FOV: " + perspectiveCamera.getFieldOfView());
scene.setCamera(perspectiveCamera);
return perspectiveCamera;
}
#Override
public void start(Stage stage) throws IOException {
File file = new File(MESH_FILENAME);
MeshView[] meshViews = loadMeshViews(file);
Group group = buildScene(meshViews);
group.setScaleX(2);
group.setScaleY(2);
group.setScaleZ(2);
group.setTranslateX(50);
group.setTranslateY(50);
Scene scene = new Scene(group, VIEWPORT_SIZE_V1, VIEWPORT_SIZE_V1,true);
scene.setFill(Color.rgb(10, 10, 40));
addCamera(scene);
stage.setScene(scene);
stage.setTitle("Example");
stage.show();
}
public static void main(String[] args) {
launch();
}
}
the result output of is:
I've followed each row of the example but something is wring. I've also tried to move the camera and change the scale...
Someone knows how can I fix it?
Thanks

Is there a way to animate elements in GridPane

I'm trying to animate elements in GridPane. I have a class Unit that represents the things that I'm trying to move.
public class Unit {
private Text text;
private Rectangle rectangle;
private StackPane stackPane;
public Unit(Text text, Rectangle rectangle) {
this.text = text;
this.rectangle = rectangle;
text.setFill(Color.WHITE);
stackPane = new StackPane(rectangle, text);
}
public Text getText() {
return text;
}
public void setText(Text text) {
this.text = text;
}
public Rectangle getRectangle() {
return rectangle;
}
public void setRectangle(Rectangle rectangle) {
this.rectangle = rectangle;
}
public StackPane getStackPane() {
return stackPane;
}
public void setStackPane(StackPane stackPane) {
this.stackPane = stackPane;
}
}
This is how i'm moving things now
public class Main extends Application {
#Override
public void start(Stage primaryStage) throws Exception{
GridPane gridPane = new GridPane();
gridPane.setVgap(5);
gridPane.setHgap(5);
Unit unit = new Unit(new Text("1"), new Rectangle(50, 50));
gridPane.add(unit.getStackPane(), 0, 0);
TranslateTransition translateTransition = new TranslateTransition();
translateTransition.setDuration(Duration.seconds(6));
translateTransition.setToX(200);
translateTransition.setToY(200);
translateTransition.setNode(unit.getStackPane());
translateTransition.play();
Scene scene = new Scene(gridPane, 300, 275);
primaryStage.setTitle("Hello World");
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Is there a way to move the unit to a specific row - column location. I assume that gridpane might not be suitable for my purpose but it's easy way to layout things the way i want.
Here is an example based upon the layout animator at Animation upon layout changes (also in the gist https://gist.github.com/jewelsea/5683558). I don't really know if it is really what you are looking for (it might be pretty close). But in any case it is pretty neat ;-)
I won't explain it too much here as the main explanation on what it is and how it works is at the previously linked question.
The referenced Unit class is the one from your question.
AnimatedSparseGrid.java
import javafx.animation.*;
import javafx.application.Application;
import javafx.collections.*;
import javafx.geometry.Point2D;
import javafx.scene.*;
import javafx.scene.layout.GridPane;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.util.Duration;
import java.util.*;
public class AnimatedSparseGrid extends Application {
private static final int NUM_UNITS = 10;
private static final int UNIT_SIZE = 30;
private static final int GRID_SIZE = 5;
private static final int GAP = 5;
private static final Duration PAUSE_DURATION = Duration.seconds(3);
private Random random = new Random(42);
private ObservableList<Unit> units = FXCollections.observableArrayList();
private GridPane gridPane = new GridPane();
#Override
public void start(Stage stage) throws Exception {
configureGrid();
LayoutAnimator animator = new LayoutAnimator();
animator.observe(gridPane.getChildren());
generateUnits();
relocateUnits();
continuouslyAnimateGrid();
stage.setScene(new Scene(gridPane));
stage.setResizable(false);
stage.show();
}
private void configureGrid() {
gridPane.setVgap(GAP);
gridPane.setHgap(GAP);
int size = GRID_SIZE * UNIT_SIZE + GAP * (GRID_SIZE - 1);
gridPane.setMinSize(size, size);
gridPane.setMaxSize(size, size);
}
private void generateUnits() {
for (int i = 0; i < NUM_UNITS; i++) {
Unit unit = new Unit(
new Text((i + 1) + ""),
new Rectangle(UNIT_SIZE, UNIT_SIZE)
);
units.add(unit);
}
}
private void relocateUnits() {
Set<Point2D> usedLocations = new HashSet<>();
for (Unit unit : units) {
Node node = unit.getStackPane();
int col;
int row;
do {
col = random.nextInt(GRID_SIZE);
row = random.nextInt(GRID_SIZE);
} while (usedLocations.contains(new Point2D(col, row)));
usedLocations.add(new Point2D(col, row));
GridPane.setConstraints(unit.getStackPane(), col, row);
if (!gridPane.getChildren().contains(node)) {
gridPane.add(node, col, row);
}
}
}
private void continuouslyAnimateGrid() {
Timeline timeline = new Timeline(
new KeyFrame(Duration.ZERO, event -> relocateUnits()),
new KeyFrame(PAUSE_DURATION)
);
timeline.setCycleCount(Animation.INDEFINITE);
timeline.play();
}
public static void main(String[] args) {
launch(args);
}
}
Some what hackish, but you can move the unit to the desired row - column, measure the new X,Y and use it for the translation.
The following code demonstrates animating from 0,0 to 20,20 :
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.util.Duration;
public class Main extends Application {
private Button move;
private Pane unitPane, root;
private GridPane gridPane;
#Override
public void start(Stage primaryStage) throws Exception{
gridPane = new GridPane();
gridPane.setVgap(5);
gridPane.setHgap(5);
unitPane = new Unit(new Text("1"), new Rectangle(50, 50)).getStackPane();
gridPane.add(unitPane, 0, 0);
move = new Button("Move");
move.setOnAction(e->animate());
root = new BorderPane(gridPane, null, null, move, null);
Scene scene = new Scene(root, 300, 275);
primaryStage.setTitle("Hello World");
primaryStage.setScene(scene);
primaryStage.show();
}
private void animate() {
//remove unit, make it invisible, and add it to desired location
gridPane.getChildren().remove(unitPane);
unitPane.setVisible(false);
gridPane.add(unitPane, 20, 20);
root.layout(); //apply top down layout pass
//get x y of new location
double x = unitPane.getLayoutX(); double y = unitPane.getLayoutY(); //measure new location
//return to original location
gridPane.getChildren().remove(unitPane);
gridPane.add(unitPane, 0, 0);
unitPane.setVisible(true);
//apply translation to x,y of new location
TranslateTransition translateTransition = new TranslateTransition();
translateTransition.setDuration(Duration.seconds(3));
translateTransition.setToX(x);
translateTransition.setToY(y);
translateTransition.setNode(unitPane);
translateTransition.play();
//when translation is finished remove from original location
//add to desired location and set translation to 0
translateTransition.setOnFinished(e->{
gridPane.getChildren().remove(unitPane);
unitPane.setTranslateX(0);unitPane.setTranslateY(0);
gridPane.add(unitPane, 20, 20);
});
}
public static void main(String[] args) {
launch(args);
}
}
class Unit {
private Text text;
private Rectangle rectangle;
private StackPane stackPane;
Unit(Text text, Rectangle rectangle) {
this.text = text;
this.rectangle = rectangle;
text.setFill(Color.WHITE);
stackPane = new StackPane(rectangle, text);
}
public Text getText() {
return text;
}
public void setText(Text text) {
this.text = text;
}
public Rectangle getRectangle() {
return rectangle;
}
public void setRectangle(Rectangle rectangle) {
this.rectangle = rectangle;
}
public StackPane getStackPane() {
return stackPane;
}
public void setStackPane(StackPane stackPane) {
this.stackPane = stackPane;
}
}

Setting background color in JavaFX not working

I am trying to code a program that takes in user input in one scene to set the background color in the second scene. Everything works except the background does not change the color, it stays white. Does anyone know why this could be happening?
public class Project extends Application {
Scene scene1, scene2;
final int WIDTH = 600;
final int HEIGHT = 600;
Label labelLightOrDark;
TextField tfLightOrDark;
private GridPane createTextFieldPane() {
GridPane gPane = new GridPane();
labelLightOrDark = new Label("Is it light or dark? ");
tfLightOrDark = new TextField();
gPane.add(labelLightOrDark, 0, 2);
gPane.add(tfLightOrDark, 1, 2);
return gPane;
}
#Override
public void start(Stage primaryStage) {
//first scene
Button btGenerate = new Button("Generate My Background!");
GridPane gPane = createTextFieldPane();
gPane.add(btGenerate, 0, 6);
Scene scene1 = new Scene(gPane, 600, 600);
//second scene
Button btReturn = new Button("Try Again!");
btReturn.setOnAction((ActionEvent event2) -> {
primaryStage.setScene(scene1);});
Pane root = new Pane();
String bColor = tfLightOrDark.getText();
if (bColor.equalsIgnoreCase("light")) {
root.setStyle("-fx-background-color: lightblue;");}
else if (bColor.equalsIgnoreCase("dark")) {
root.setStyle("-fx-background-color: darkblue;");}
root.getChildren().add(btReturn);
Scene scene2 = new Scene(root, 600, 600);
btGenerate.setOnAction((ActionEvent event) -> {
primaryStage.setScene(scene2);
});
primaryStage.setTitle("Create Your Own Background!");
primaryStage.setScene(scene1);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
I believe the problem has to do with my if, else if statements because when I comment out these lines it does set the background of the second scene to light blue.
//if (bColor.equalsIgnoreCase("light")) {
root.setStyle("-fx-background-color: lightblue;");}
//else if (bColor.equalsIgnoreCase("dark")) {
//root.setStyle("-fx-background-color: darkblue;");}
Everything is OK, but keep a ref to whats clicked. Here is the code.
Scene scene1, scene2;
final int WIDTH = 600;
final int HEIGHT = 600;
Label labelLightOrDark;
TextField tfLightOrDark;
private GridPane createTextFieldPane() {
GridPane gPane = new GridPane();
labelLightOrDark = new Label("Is it light or dark? ");
tfLightOrDark = new TextField();
gPane.add(labelLightOrDark, 0, 2);
gPane.add(tfLightOrDark, 1, 2);
return gPane;
}
#Override
public void start(Stage primaryStage) {
//first scene
Button btGenerate = new Button("Generate My Background!");
GridPane gPane = createTextFieldPane();
gPane.add(btGenerate, 0, 6);
Scene scene1 = new Scene(gPane, 600, 600);
//second scene
Button btReturn = new Button("Try Again!");
btReturn.setOnAction((ActionEvent event2) -> {
primaryStage.setScene(scene1);
});
Pane root = new Pane();
root.getChildren().add(btReturn);
Scene scene2 = new Scene(root, 600, 600);
btGenerate.setOnAction((ActionEvent event) -> {
primaryStage.setScene(scene2);
if (tfLightOrDark.getText().contains("light")) {
root.setStyle("-fx-background-color: lightblue;");
}
else if (tfLightOrDark.getText().contains("dark")) {
root.setStyle("-fx-background-color: darkblue;");
}
});
primaryStage.setTitle("Create Your Own Background!");
primaryStage.setScene(scene1);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
The problem with the code is you are checking for the value in the text field before the scenegraph is rendered. You need to move the if-else logic to button onAction.
btGenerate.setOnAction((ActionEvent event) -> {
String bColor = tfLightOrDark.getText();
if (bColor.equalsIgnoreCase("light")) {
root.setStyle("-fx-background-color: lightblue;");
} else if (bColor.equalsIgnoreCase("dark")) {
root.setStyle("-fx-background-color: darkblue;");
}
primaryStage.setScene(scene2);
});

How can I possibly draw a JavaFX video in a JFrame's canvas?

Basically, I want to "add" a JavaFX video to a Java Swing JFrame, but I also want to draw in that canvas, to do other things while playing the video. I use this code to play the video:
public class ExtVideoPlayer extends Application implements dev.ckitty.kc.utils.interf.MediaPlayer {
#Override
public MediaPlayerType[] getAcceptedTypes() {
return new MediaPlayerType[] { MediaPlayerType.VIDEO };
}
#Override
public void init(File f, String s) {
}
#Override
public void start() {
ExtVideoPlayer.launch(new String[0]);
}
#Override
public void command(String[] args) {
}
#Override
public void stop() {
}
#Override
public void start(Stage primaryStage) throws Exception {
StackPane root = new StackPane();
File video = new File("C:\\Users\\980001005\\Videos\\IMG_6503.mp4");
String url = video.toURI().toURL().toString();
Media media = new Media(url);
MediaPlayer player = new MediaPlayer(media);
MediaView mediaView = new MediaView(player);
root.getChildren().add(mediaView);
Scene scene = new Scene(root, mediaView.getFitWidth(), mediaView.getFitHeight());
primaryStage.setScene(scene);
primaryStage.show();
player.play();
}
}
This works fine, but creates other windows! Of course I could just make it pop-out videos but that would look awful.
I want it to look like Youtube, for example. People would be able to vote for a video and the votes would be shown where Youtube shows recommended videos and adds.
There are some tricks I've seen to put the video inside the JFrame as a Component, but I want it to have a Canvas I can use as well. (So I can draw over the playing video or something)
Please Help!
EDIT!
This answer seems like the one I have to use.
EDIT 2
Now I got the canvas and the video in the same JFrame, however, the canvas is not transparent!
The code
public class LayeredDisplay extends Display {
protected JLayeredPane pane;
protected JPanel ontop, behind;
protected JFXPanel jfxPanel;
public LayeredDisplay(String title, int w, int h) {
super(title, w, h, false);
this.createLayers();
this.frame.pack();
this.frame.requestFocus();
this.frame.setSize(w, h);
this.frame.setVisible(true);
}
protected void createLayers() {
this.jfxPanel = new JFXPanel();
this.canvas = new Canvas();
Dimension dim = new Dimension(this.w, this.h);
this.canvas.setPreferredSize(dim);
this.canvas.setMaximumSize(dim);
this.canvas.setMinimumSize(dim);
this.canvas.setFocusable(false);
//this.ontop.add(this.canvas);
//pane.add(this.ontop, 2);
//pane.add(this.behind, 1);
this.frame.add(this.jfxPanel, 0);
this.frame.add(canvas, 1);
}
public JLayeredPane getPane() {
return this.pane;
}
public JPanel getFront() {
return this.ontop;
}
public JPanel getBack() {
return this.behind;
}
public void addComponent(Component comp) {
this.behind.add(comp);
}
public void addVideo(File video1) {
Util.initJavaFX();
SwingUtilities.invokeLater(new Runnable() {
#Override
public void run() {
//Code to change Swing data.
File video = new File("C:\\Users\\980001005\\Videos\\IMG_6503.mp4");
String url = null;
try {
url = video.toURI().toURL().toString();
} catch (MalformedURLException e) {
e.printStackTrace();
}
Media media = new Media(url);
MediaPlayer player = new MediaPlayer(media);
MediaView view = new MediaView(player);
player.play();
jfxPanel.setScene(new Scene(new Group(view)));
}
});
}
}
The Display class I'm extending holds the canvas and the JFrame and gives me the Graphics object to draw in the canvas, nothing special.
I got the result I needed!
I put the JFXPanel in a class to manage the video. You basically need to add the JFXPanel into a JPanel
public class FramePlayer {
private Display disp;
private JFXPanel jfxPanel;
private int w, h;
public FramePlayer(Display disp, int w, int h, boolean autoInit) {
this.disp = disp;
this.w = w;
this.h = h;
if(autoInit) this.init();
}
public void init() {
this.jfxPanel = new JFXPanel();
Dimension dim = new Dimension(w, h);
this.jfxPanel.setPreferredSize(dim);
this.jfxPanel.setBackground(new Color(0, 0, 0, 255));
this.jfxPanel.setOpaque(false);
this.disp.getFrame().add(this.jfxPanel, 1);
}
public void addVideo(File video1) {
Util.initJavaFX();
SwingUtilities.invokeLater(new Runnable() {
#Override
public void run() {
// Code to change Swing data.
File video = new File("C:\\Users\\980001005\\Videos\\IMG_6503.mp4");
String url = null;
try {
url = video.toURI().toURL().toString();
} catch (MalformedURLException e) {
e.printStackTrace();
}
Media media = new Media(url);
MediaPlayer player = new MediaPlayer(media);
MediaView view = new MediaView(player);
Group g = new Group(view);
Scene s = new Scene(g);
s.setFill(Paint.valueOf("TRANSPARENT")); // THIS MAKES IT TRANSPARENT!
player.play();
jfxPanel.setScene(s);
}
});
}
public void renderVideo() {
this.jfxPanel.paint(this.disp.getGfx().get());
}
public void renderVideo(KCGraphics gfx) {
this.jfxPanel.paint(gfx.get());
}
}
You need to
1. add the JFXPanel to the JPanel
2. force drawing the JFXPanel into the canvas (well, that's what I had to do..)
3. enjoy!

Not allowing draw on button in JavaFX

I am new to JavaFX.
Please have a look at attached image where i want to restrict drawing on button.
And please also suggest me for printing to printer.
(In swing, it is possible with PrintJob and Toolkit class)
Below is my code :
public class PrintScribble extends Application {
private short last_x = 0, last_y = 0; // last click posistion
private Vector lines = new Vector(256, 256); // store the scribble
private Properties printprefs = new Properties(); // store user preferences
private Path path;
#Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("PrintScribble");
Group root = new Group();
Scene scene = new Scene(root, 400, 400);
BorderPane bp = new BorderPane();
bp.setPadding(new Insets(10, 10, 10, 10));
bp.setMinWidth(scene.getWidth());
Button b = new Button("Print");
bp.setRight(b);
root.getChildren().add(bp);
b.setOnAction(new EventHandler<ActionEvent>() {
#Override
public void handle(ActionEvent event) {
System.out.println("Printer call");
//print();
}
});
path = new Path();
scene.setOnMouseClicked(mouseHandler);
scene.setOnMouseDragged(mouseHandler);
scene.setOnMouseEntered(mouseHandler);
scene.setOnMouseExited(mouseHandler);
scene.setOnMouseMoved(mouseHandler);
scene.setOnMousePressed(mouseHandler);
scene.setOnMouseReleased(mouseHandler);
root.getChildren().add(path);
primaryStage.setScene(scene);
primaryStage.show();
}
EventHandler<MouseEvent> mouseHandler = new EventHandler<MouseEvent>() {
#Override
public void handle(MouseEvent mouseEvent) {
if (mouseEvent.getEventType() == MouseEvent.MOUSE_PRESSED) {
path.getElements()
.add(new MoveTo(mouseEvent.getX(), mouseEvent.getY()));
} else if (mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED) {
path.getElements()
.add(new LineTo(mouseEvent.getX(), mouseEvent.getY()));
}
}
};
/**
* The main method. Create a PrintScribble() object and away we go!
*/
public static void main(String[] args) {
launch(args);
}
}
public void handle(MouseEvent mouseEvent) {
if (mouseEvent.getEventType() == MouseEvent.MOUSE_PRESSED) {
path.getElements()
.add(new MoveTo(mouseEvent.getX(), mouseEvent.getY()));
} else if (mouseEvent.getEventType() == MouseEvent.MOUSE_DRAGGED) {
path.getElements()
.add(new LineTo(mouseEvent.getX(), mouseEvent.getY()));
}
// Here is an answer
path.toBack();
}

Categories