Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

could you please properly comment on the program below //************************************************************************************** // SliderTest.java // // Auther: Yosef Yohannes Ayele(T00678563) // The purpose of this JavaFX application

could you please properly comment on the program below

//************************************************************************************** // SliderTest.java // // Auther: Yosef Yohannes Ayele(T00678563) // The purpose of this JavaFX application is to displays a Text object and a slider that controls the font size of the text //**************************************************************************************

import javafx.application.Application; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Slider; import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage;

/** * * @author PgcDev */ public class SliderText extends Application { private Text text; private Slider slider; private VBox vbox; private Font font; private double initVal = 20; @Override public void start(Stage primaryStage) { text = new Text("FINALLY DONE"); slider = new Slider(0,75,50); text.setFont(new Font(initVal)); vbox = new VBox(text,slider); vbox.setAlignment(Pos.CENTER); Scene scene = new Scene(vbox, 400, 400); primaryStage.setScene(scene); primaryStage.show(); slider.valueProperty().addListener(new ChangeListener() { public void changed(ObservableValue observable, Number oldValue, Number newValue) { text.setFont(new Font(newValue.doubleValue())); throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }); } public static void main(String[] args) { launch(args); } }

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

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions