Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i mport javafx. *.* public class BallM extends ___________________ _{ public void start( ___________ stage){ Pane pane = new Pane( ); Scene scene = new

import javafx.*.*

public class BallM extends ____________________{

public void start(___________ stage){

Pane pane = new Pane();

Scene scene = new Scene(pane,300, 300);

mBall ball1 = new mBall(100,100,20,Color.RED, 5); // x, y, radius, color and speed

stage.______________("Moving Ball");

stage.setScene(scene);

pane.getChildren().add(ball1);

____________ . setOnKeyPressed ( e -> {

switch ( ____.getCode()) {

case DOWN: moveDOWN(); break; // use a method in mBall (next page)

case UP:_______________________________ // use a method in mBall

//?????? complete the rest

default: System.out.print("Not a valid key");

}

}); //check: switch statement usually need break statements

ball1.requestFocus();

stage.___________________

}

public static void main(String[] args) {

__________________________

}

//this is an inner class of BallM

//mBall extends Circle, so it can use all of the Circlessconstructors, methods, and properties.

class mBall extends Circle{

int speed;

mBall(int X, int Y, int R, Color c, int S){

____________(X, Y, R, c); //need to use super classs constructor

speed=____________;

}

void moveDOWN() { // need to use set and get methods

???? complete this part

}

????? complete the rest:

}

}

Fill the blank and complete the rest of the code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions