Question
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started