Introduction to Java Programming and Data Structures, Comprehensive Version, Student Value Edition (11th Edition)
Expert Solution & Answer
Book Icon
Chapter 15.10, Problem 15.10.1CP

Explanation of Solution

Purpose of the given code:

The purpose of the given code is resizing objects placed inside based on the window size. In the given code a rectangle and circle is placed inside the stack pane, the object gets resized based on the window size.

Given code:

//import the required packages

import javafx.application.Application ;

import javafx.scene.paint.Color ;

import javafx.scene.shape .Circle ;

import javafx.scene.shape.Rectangle ;

import javafx .stage.Stage;

import javafx.scene.Scene;

import javafx .scene.control .Label ;

import javafx.scene.layout.StackPane ;

//define the method ResizableCircleRectangle

public class ResizableCircleRectangle extends Application

{

//Create a circle

private Circle circle= new Circle( 60) ;

//new rectangle gets created

private Rectangle rectangle = new Rectangle( 120 , 120);

// Place clock and label in border pane

private StackPane pane = new StackPane() ;

@Override

// Override the start method in the Application class

public void start(Stage primaryStage)

{

//set the fill color of circle

circle.setFill (Color.GRAY) ;

//set the fill color of rectangle

rectangle.setFill (Color.WHITE);

//set the stroke color

rectangle.setStroke(Color.BLACK);

//add all to the pane

pane.getChildren() .addAll (rectangle, circle);

//new scene gets created and placed on the stage

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

//set the title of the stage

primaryStage.setTitle( "ResizableCircleRectangle" );

//the scene gets placed on the stage

primaryStage .setScene(scene);

//the stage gets displayed

primaryStage.show();

//set the height property

pane.widthProperty().addListener(ov ->resize()) ;

//set the width property

pane.heightProperty() .addListener(ov -> resize());

}

//define the method resize

private void resize()

{

//define length of the pane

double length= Math...

Blurred answer
Students have asked these similar questions
Complete question is given in the image.
OO 一陽齊畫風 7. Which statement best describes the quality of line in the depiction of these figures? Oa. Both figures are depicted using only rigid vertical and horizontal lines. b. One of the figures is depicted using only curving lines; the lines in the other are all vertical. c. One of the figures is depicted using very active curving and zigzag lines; the lines in the other figure are calmer and contained. d. The lines in both depictions are smooth and give the sense of stasis or rest. 8. Which description best applies to these artworks? a. Black and white are the only colors used in these artworks. Ob. The figures are depicted against a busy urban setting. c. Both of the figures wear costumes of rich purple and gold. O d. The figures are both rendered against a largely blank background. Icon Key la2earev05h_ch02 Multi.04 XI
Task 1: You will consider the effects of additive noise and the use of DFT to remove this kind of noise. The noisy image has been generated by adding noise in the form of a cosine function. Using frequency domain filtering, devise a procedure for removing the noise and show your results. For comparison purposes, remove the noise in the spatial domain by convolving the noisy image with Average filter (e.g., 7 x 7 and 15 x 15). Compare resulting images of both spatial and frequency domain filtering. Also, you can elaborate on differences in the jupyter notebook as a comment.

Chapter 15 Solutions

Introduction to Java Programming and Data Structures, Comprehensive Version, Student Value Edition (11th Edition)

Ch. 15.6 - Prob. 15.6.1CPCh. 15.6 - What is a functional interface? Why is a...Ch. 15.6 - Prob. 15.6.3CPCh. 15.8 - Prob. 15.8.1CPCh. 15.8 - Prob. 15.8.2CPCh. 15.9 - Prob. 15.9.1CPCh. 15.9 - Prob. 15.9.2CPCh. 15.9 - Prob. 15.9.3CPCh. 15.9 - If the following code is inserted in line 57 in...Ch. 15.10 - Prob. 15.10.1CPCh. 15.11 - Prob. 15.11.1CPCh. 15.11 - Prob. 15.11.2CPCh. 15.11 - Prob. 15.11.3CPCh. 15.11 - Prob. 15.11.4CPCh. 15.12 - How does the program make the ball appear to be...Ch. 15.12 - How does the code in Listing 15.17, BallPane.java,...Ch. 15.12 - What does the program do when the mouse is pressed...Ch. 15.12 - If line 32 in Listing 15.18, BounceBall.java, is...Ch. 15.12 - Prob. 15.12.5CPCh. 15.13 - Prob. 15.13.1CPCh. 15.13 - What would happen if map is replaced by scene in...Ch. 15.13 - Prob. 15.13.3CPCh. 15 - Prob. 15.1PECh. 15 - (Rotate a rectangle) Write a program that rotates...Ch. 15 - (Move the ball) Write a program that moves the...Ch. 15 - (Create a simple calculator) Write a program to...Ch. 15 - (Create an investment-value calculator) Write a...Ch. 15 - (Alternate two messages) Write a program to...Ch. 15 - (Change color using a mouse) Write a program that...Ch. 15 - (Display the mouse position) Write two programs,...Ch. 15 - (Draw lines using the arrow keys) Write a program...Ch. 15 - (Enter and display a string) Write a program that...Ch. 15 - (Move a circle using keys) Write a program that...Ch. 15 - Prob. 15.12PECh. 15 - (Geometry: inside a rectangle?) Write a program...Ch. 15 - Prob. 15.14PECh. 15 - Prob. 15.15PECh. 15 - (Two movable vertices and their distances) Write a...Ch. 15 - (Geometry: find the bounding rectangle) Write a...Ch. 15 - Prob. 15.18PECh. 15 - (Game: eyehand coordination) Write a program that...Ch. 15 - Prob. 15.20PECh. 15 - (Drag points) Draw a circle with three random...Ch. 15 - (Auto resize cylinder) Rewrite Programming...Ch. 15 - Prob. 15.23PECh. 15 - Prob. 15.24PECh. 15 - Prob. 15.25PECh. 15 - Prob. 15.26PECh. 15 - Prob. 15.27PECh. 15 - (Display a running fan) Write a program that...Ch. 15 - (Racing car) Write a program that simulates car...Ch. 15 - Prob. 15.30PECh. 15 - Prob. 15.31PECh. 15 - (Control a clock) Modify Listing 14.21,...Ch. 15 - (Game: bean-machine animation) Write a program...Ch. 15 - Prob. 15.34PECh. 15 - Prob. 15.35PECh. 15 - Prob. 15.36PE
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage