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
}
}
Do you need any assistance with this question?
Send us your paper details now
We’ll find the best professional writer for you!
"We offer the best custom paper writing services. We have done this question before we can also do it for you."
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
Our Service Charter
1. Professional & Expert Writers: Experts Essays only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.
2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.
3. Plagiarism-Free Papers: All papers provided by Experts Essays are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.
4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Experts Essays are known for the timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.
5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.
6. 24/7 Customer Support: At Experts Essays, we have put in place a team of experts who answer all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.