JAVA this is the code import javaioInputStream import javaf

JAVA

this is the code

//////////////////

import java.io.InputStream;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class MazeGUIPane extends Application
{

@Override
public void start(Stage primaryStage)
{   
WebView mapView = new WebView();
WebEngine webEngine = mapView.getEngine();
String url = \"http://street360.net/spain/navarre/pamplona_navarre.php\";
url += \"&output=embed\";
webEngine.load(url);

VBox vBox = new VBox(5);
vBox.getChildren().add(mapView);

InputStream instream = MazeGUIPane.class.getResourceAsStream(\"traffic.png\");
Image trafficImage = new Image(instream);

instream = MazeGUIPane.class.getResourceAsStream(\"roads.jpg\");
Image roadsImage = new Image(instream);

Marker RedMarker = new Marker(trafficImage, \"Red\");
laTunaMarker.setLayoutX(320);
laTunaMarker.setLayoutY(440);

Marker pamplonaMarker = new Marker(roadsImage, \"pamplona\");
rosariosMarker.setLayoutX(450);
rosariosMarker.setLayoutY(400);

Group root = new Group();
root.getChildren().add(vBox);
root.getChildren().add(RedMarker);
root.getChildren().add(pamplonaMarker);
Scene scene = new Scene(root);

primaryStage.setTitle(\"Hello street of Pamplona!\");
primaryStage.setScene(scene);
primaryStage.show();
}

public static void main(String[] args){
  
launch(args);
}

class Marker extends Group{
  
public Marker(Image image, String text){
  
ImageView imageView = new ImageView(image);
Label label = new Label(text);
VBox vbox = new VBox(5);
vbox.getChildren().add(imageView);
vbox.getChildren().add(label);
getChildren().add(vbox);
}
}

}

/////////////// and

Marker RedMarker = new Marker(trafficImage, \"Red\");
laTunaMarker.setLayoutX(320);
laTunaMarker.setLayoutY(440);

Marker pamplonaMarker = new Marker(roadsImage, \"pamplona\");
rosariosMarker.setLayoutX(450);
rosariosMarker.setLayoutY(400);

shows error

Solution

import java.io.InputStream;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class MazeGUIPane extends Application
{

@Override
public void start(Stage primaryStage)
{   
WebView mapView = new WebView();
WebEngine webEngine = mapView.getEngine();
String url = \"http://street360.net/spain/navarre/pamplona_navarre.php\";
url += \"&output=embed\";
webEngine.load(url);

VBox vBox = new VBox(5);
vBox.getChildren().add(mapView);

InputStream instream = MazeGUIPane.class.getResourceAsStream(\"traffic.png\");
Image trafficImage = new Image(instream);

instream = MazeGUIPane.class.getResourceAsStream(\"roads.jpg\");
Image roadsImage = new Image(instream);

Marker RedMarker = new Marker(trafficImage, \"Red\");
laTunaMarker.setLayoutX(320);
laTunaMarker.setLayoutY(440);

Marker pamplonaMarker = new Marker(roadsImage, \"pamplona\");
rosariosMarker.setLayoutX(450);
rosariosMarker.setLayoutY(400);

Group root = new Group();
root.getChildren().add(vBox);
root.getChildren().add(RedMarker);
root.getChildren().add(pamplonaMarker);
Scene scene = new Scene(root);

primaryStage.setTitle(\"Hello street of Pamplona!\");
primaryStage.setScene(scene);
primaryStage.show();
}

public static void main(String[] args){
  
launch(args);
}

class Marker extends Group{
  
public Marker(Image image, String text){
  
ImageView imageView = new ImageView(image);
Label label = new Label(text);
VBox vbox = new VBox(5);
vbox.getChildren().add(imageView);
vbox.getChildren().add(label);
getChildren().add(vbox);
}
}

}

/////////////// and

Marker RedMarker = new Marker(trafficImage, \"Red\");
laTunaMarker.setLayoutX(320);
laTunaMarker.setLayoutY(440);

Marker pamplonaMarker = new Marker(roadsImage, \"pamplona\");
rosariosMarker.setLayoutX(450);
rosariosMarker.setLayoutY(400);

}

the code block was not closed properly.

JAVA this is the code ////////////////// import java.io.InputStream; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene
JAVA this is the code ////////////////// import java.io.InputStream; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene
JAVA this is the code ////////////////// import java.io.InputStream; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site