Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
bartleby

Concept explainers

bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 14, Problem 8AW

Explanation of Solution

setScaleX method:

  • The “setScaleX” method scales a node in its X dimension.
  • It can be used to scale any node in scene graph.
  • A “double” argument is passed to the method that denotes scaling factor.
  • To retain node into original manner, both X and Y dimensions should be scaled same.
  • If different values are used for X and Y dimensions then node will seem stretched.

Example:

The example for “setScaleX” method is given below:

Rectangle bx = new Rectangle(X, Y, W, H);

bx.setScaleX(0.5);

Here, “bx” denotes an object of “Rectangle” class. The values “X” and “Y” denotes coordinates of rectangle and “W” and “H” denotes width as well as height of rectangle respectively. The given code generates a rectangle with given dimensions and scales the rectangle at particular scale factor specified.

setScaleY method:

  • The “setScaleY” method scales a node in its Y dimension.
  • It can be used to scale any node in scene graph...

Blurred answer
Students have asked these similar questions
Imagine that you are a programmer and the restaurant "the brothers" hire you to develop a program that allows you to place orders for the restaurant, in the first instance, make the order menu in Visual Basic, it should have the following aspects: -# Table number, this will be entered by the waiter-List of food, drinks and prices based on the menu, should be within the same GrupBox-Attach an exit button-The design is free-The waiter must have the option to select one or more foods or drinks from the menu Menu(Food)-Chocolate donut $15-Vanilla donut $15-Panini $25-Bownies $30-Chocolate cookies $10 Menu(Drinks)-Coca cola soft drink $15-Pepsi soft drink $15-American coffee $!5-Espresso coffee $15-Water $20 Need-The code,-The menu screen,-Data entry-The selection of data
Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A, B, C, D, E" is correct. Each question has one correct answer. Thank you. Part 1 - Which method do you need to invoke to display a frame (or a "form")? A. displayWindow = true;B. setVisible = true;C. setVisible(true);D. setDisplay(true);E. setShowForm(true); Part 2 - Which sets the frame (or a "form") width to 100 pixels and the height to 200 pixels? A. setSize(100, 200);B. setSize(200, 100);C. setDims(100, 200);D. setDimensions(200, 100);E. setWidth(100); setHeight(100);
Suppose you would like an application that displays a green square inside a black circle. Write a paint() method that will draw the image.

Chapter 14 Solutions

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Ch. 14.1 - Prob. 14.11CPCh. 14.1 - Which of the following is not a subclass of the...Ch. 14.2 - Prob. 14.13CPCh. 14.2 - Prob. 14.14CPCh. 14.2 - Prob. 14.15CPCh. 14.2 - Prob. 14.16CPCh. 14.2 - Prob. 14.17CPCh. 14.2 - Prob. 14.18CPCh. 14.2 - Prob. 14.19CPCh. 14.2 - Prob. 14.20CPCh. 14.2 - Prob. 14.21CPCh. 14.3 - Prob. 14.22CPCh. 14.3 - Prob. 14.23CPCh. 14.3 - Prob. 14.24CPCh. 14.3 - Prob. 14.25CPCh. 14.3 - Prob. 14.26CPCh. 14.3 - Prob. 14.27CPCh. 14.3 - Prob. 14.28CPCh. 14.3 - Prob. 14.29CPCh. 14.3 - Prob. 14.30CPCh. 14.4 - What two classes do you use to play an audio file?Ch. 14.4 - Refer to your answer to Checkpoint 14.31. In what...Ch. 14.4 - Prob. 14.33CPCh. 14.4 - Prob. 14.34CPCh. 14.5 - What three classes do you use to play a video...Ch. 14.5 - Refer to your answer to Checkpoint 14.35. In what...Ch. 14.5 - Prob. 14.37CPCh. 14.6 - Prob. 14.38CPCh. 14.6 - Prob. 14.39CPCh. 14.6 - What type of event happens when the user presses...Ch. 14.6 - What KeyEvent method can you call to determine...Ch. 14.6 - Refer to your answer for Checkpoint 14.41. What...Ch. 14 - Line, Circle, and Rectangle are subclasses of...Ch. 14 - Prob. 2MCCh. 14 - Prob. 3MCCh. 14 - Prob. 4MCCh. 14 - Prob. 5MCCh. 14 - Prob. 6MCCh. 14 - Prob. 7MCCh. 14 - Prob. 8MCCh. 14 - This interpolator causes an animation to start...Ch. 14 - You use these two classes to play an audio file....Ch. 14 - Prob. 11TFCh. 14 - Prob. 12TFCh. 14 - True or False: If an ellipses X-radius and...Ch. 14 - Prob. 14TFCh. 14 - Prob. 15TFCh. 14 - Write a statement that instantiates the Line...Ch. 14 - Prob. 2AWCh. 14 - Prob. 3AWCh. 14 - Write code that does the following: Instantiates...Ch. 14 - Prob. 5AWCh. 14 - Prob. 6AWCh. 14 - Prob. 7AWCh. 14 - Prob. 8AWCh. 14 - Prob. 9AWCh. 14 - Prob. 10AWCh. 14 - Prob. 11AWCh. 14 - Prob. 1SACh. 14 - Prob. 2SACh. 14 - Prob. 3SACh. 14 - Prob. 4SACh. 14 - Prob. 5SACh. 14 - Prob. 6SACh. 14 - What RotateTransition class method do you use to...Ch. 14 - Prob. 8SACh. 14 - Prob. 9SACh. 14 - Prob. 10SACh. 14 - Prob. 11SACh. 14 - This Old House Use the basic shapes you learned in...Ch. 14 - Tree Age Counting the growth rings of a tree is a...Ch. 14 - Hollywood Star Make your own star on the Hollywood...Ch. 14 - Prob. 4PCCh. 14 - Solar System Use the Circle class to draw each of...Ch. 14 - Prob. 6PCCh. 14 - Prob. 7PCCh. 14 - Prob. 8PCCh. 14 - Coin Toss Write a program that simulates the...Ch. 14 - Lunar Lander The books online resources...Ch. 14 - Change for a Dollar Game The books online...Ch. 14 - Rock, Paper, Scissors Game Write a program that...
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781305480537
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    Microsoft Visual C#
    Computer Science
    ISBN:9781337102100
    Author:Joyce, Farrell.
    Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY