Get your original paper written from scratch starting at just $10 per page with a plagiarism report and free revisions included!
The following program draws an BB-8 as shown below. Modify the program to move the BB-8 left or right using the arrow keys. The program can be download from the CMS. Please use Javafx
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.stage.Stage;
public class MovingBB8 extends Application {
@Override // Override the start method in the Application class
public void start(Stage primaryStage) {
BB8Pane pane = new BB8Pane();
pane.setOnKeyPressed(e -> {
// Write code here
});
// Create scene and place it in the stage
Scene scene = new Scene(pane, 400, 120);
primaryStage.setTitle(“MovingBB8”);
primaryStage.setScene(scene);
primaryStage.show();
pane.requestFocus();
}
}
class BB8Pane extends Pane {
private Circle circle1 = new Circle(200, 50, 15);
private Circle circle2 = new Circle(200, 70, 20);
private Line line = new Line(200, 25, 200, 35);
public BB8Pane() {
line.setStroke(Color.BLACK);
circle1.setFill(Color.CORAL);
circle2.setFill(Color.CORAL);
getChildren().addAll(circle1, circle2, line);
}
public void moveLeft() {
// Write code here
}
public void moveRight() {
// write code here
}
}
The aim of our service is to provide you with top-class essay help when you ask us to write my paper; we do not collect or share any of your personal data. We use the email you provide us to send you drafts, final papers, and the occasional promotion and discount code, but that’s it!
Order Now