Marian Fluencia × / Chapter 34 PDF-ClST23· X Module Calendar _CIST2 https://gptc
ID: 3682888 • Letter: M
Question
Marian Fluencia × / Chapter 34 PDF-ClST23· X Module Calendar _CIST2 https://gptc blackboard.com/webapps/blackboard/execute/displayLearningUnit?course_id Apps M McGraw-Hill Connect G ANGEL Learning G Google Java Platform Standar G Chegg - Get 24/7 Ho Mermaid Beach Wedlc 16741&content; id--118503 1&framesetWrapped;=true Hotel Fondant Packag Paradise Found w/ Ca Apocalypse Tattoo Exerdise34 09 COURSE CONTENT Exerdse34 07 Calendar ma Angle: 59Rotate Scale factor for x11 y 0.9 Scale My Grades Figure 34.38 (a) Exercise 34.7 translates coordinates (b) Exercise 34.8 rotates coordinates. (c) Exercise 34.9 scales coordinates 34.8 (Rotation) Write a program that displays an ellipse. The ellipse is centered in the pane with width 60 and height 40. Enter the value in the text field Angle and press the Rotate button to rotate the ellipse, as shown in Figure 34.38b 34.9* (Scale graphics) Write a program that displays an ellipse. The ellipse is centered in the pane with width 60 and height 40. Enter the scaling factors in the text fields and press the Scale button to scale the ellipse, as shown in Figure 34.38c 34.10 (Plot the sine function) Write a program that plots the sine function, as shown in Figure 34.39a Exerse34-11 O e 10:48 PM 3/28/2016 Search the web and WindowsExplanation / Answer
Answer:
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.scene.shape.Ellipse;
public class exercise34_9 extends Application {
@Override
public void start(Stage primaryStage) {
FlowPane root1 = new FlowPane(3,3);
TextField t1=new TextField();
TextField t2=new TextField();
Label l1=new Label("Scale factor for x");
Label l2=new Label("y");
Button btn1 = new Button();
btn1.setText("Scale'");
btn1.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
}
});
root1.getChildren().addAll(l1,t1,l1,t2,btn1);
Ellipse e1=new Ellipse(10,20,60,40);
StackPane centerpane=new StackPane();
centerpane.getChildren().add(e1);
BorderPane pane1=new BorderPane();
pane1.setCenter(centerpane);
pane1.setBottom(root1);
Scene scene1 = new Scene(pane1, 300, 250);
primaryStage.setTitle("Exercise 34_9");
primaryStage.setScene(scene1);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.