Question: Modify the QuoteOptions Program to change its visual appereance. Present the radio buttons in a vertical column with surrounding border to the left of the

Modify the QuoteOptions Program to change its visual appereance. Present the radio buttons in a vertical column with surrounding border to the left of the quote label.

import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.stage.Stage; public class QuoteOptions extends Application { public void start(Stage primaryStage){ QuoteOptionsPane pane = new QuoteOptionsPane(); pane.setAlignment (Pos.CENTER); pane.setStyle("-fx-background-color: lightgreen"); Scene scene = new Scene (pane, 500, 150);

primaryStage.setTitle("Quote Option"); primaryStage.setScene(scene); primaryStage.show(); } }

import javafx.event.ActionEvent; import javafx.geometry.Pos; import javafx.scene.control.RadioButton; import javafx.scenecontrol.ToggleGroup; import javafx.scene.layout.HBox; import javafx.scene.layout.StackGroup; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.text.Font; //****************************************************************** //QuoteOptionsPane.Java Author: Melkamu Section: CSIT112_01 // //Demenostrate the use of radio buttons. //****************************************************************** public class QuoteOptionsPane extends HBox{ private Text quote; private string philosophyQuote, carpntryQoute, comedyQuote; private RadioButton philosophyButton, carperntryButton, comedyButton; public class QuoteOptionsPane(){ philosophyQuote = "I think therefore I am."; carpntryQoute = "Measure twice. Cut once"; comedyQuote = "Take my wife. Please."; quote = new Text(PhilosophyQuate); quote.setFont(new Font("Helvetica", 24)); StackPane.setPane = new StackPane(quote); quotePane.setPrefsize(300,100); ToggleGroup group = new ToggleGroup(); philosophyButton = new RadioButton("Philosphy"); philosophyButton.setSelected(true); philosophyButton.setToggleGroup(group); philosophyButtonsetAction(this: : processRadioButtonAction); curpentryButton =new RadioButton(Carpentry); curpentryButton.setTaggleGroup(group); curpentryButton.setOnAction(this ::processRadioButton); comedyButton = new RadioButton("Comedy"); comedyButton.setToggleGroup(group); comedyButton.setOnAction(this:: processRadioButtonAction); VBox option = new VBox(philosophyButton, carpentryButton, comedyButtonButton); options.setAlignment(Pos.CENTER_LEFT); option.setSpacing(10); setSpacing().addAll (options, quotePane); } public void processRadioButtonAction (ActionEvent event){ if (philosophyButton.isSelect()) quote.setText(philosophyQuote); else if (carpentryButton.isSelected()) quote.setText(carpentryQute); else quote.setText(comedyQuote); } }

Modify the QuoteOptions Program to change its visual appereance. Present the radio

Quote Options 2 O Comedy Philosophy Take my wife, please Carpentry Quote Options 2 O Comedy Philosophy Take my wife, please Carpentry

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!