Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.CheckBox; import javafx.scene.control.ComboBox; import javafx.scene.control.ContentDisplay; import javafx.scene.control.Label; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.text.Font; import

image text in transcribed

import javafx.application.Application; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.CheckBox; import javafx.scene.control.ComboBox; import javafx.scene.control.ContentDisplay; import javafx.scene.control.Label; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.layout.StackPane; import javafx.scene.text.Font; import javafx.scene.text.FontPosture; import javafx.scene.text.FontWeight; import javafx.scene.text.Text; import javafx.stage.Stage; public class bold extends Application { Text t123 = new Text("Hello Professor Verma "); ComboBox cb_Families = new ComboBox(); CheckBox ch_value = new CheckBox("Bold"); ComboBox comhs = new ComboBox(); CheckBox ch_Italicval = new CheckBox("Italic"); @Override public void start(Stage pstage) { Integer[] sizesval = new Integer[100]; for (int k1 = 0; k1 process()); Label label_font = new Label("Font Name", cb_Families); label_font.setContentDisplay(ContentDisplay.RIGHT); comhs.getItems().addAll(getsizesval()); comhs.setValue((int)t123.getFont().getSize()); comhs.setOnAction(e -> { process(); pstage.sizeToScene(); }); Label labelfont = new Label("Font Size",comhs); labelfont.setContentDisplay(ContentDisplay.RIGHT); HBox tpane = new HBox(label_font, labelfont); tpane.setSpacing(6); tpane.setPadding(new Insets(6)); // Bottom ch_value.setOnAction(e-> process()); ch_Italicval.setOnAction(e-> process()); HBox bottomP123 = new HBox(ch_value, ch_Italicval); bottomP123.setAlignment(Pos.CENTER); StackPane cpane = new StackPane(t123); BorderPane bpane = new BorderPane(cpane); bpane.setTop(tpane); bpane.setBottom(bottomP123); pstage.setTitle("Bonus Exercise"); //call the borderpane pstage.setScene(new Scene(bpane)); pstage.show(); } private void process(){ FontWeight fontWeight12 = (ch_value.isSelected()) ? FontWeight.BOLD : FontWeight.NORMAL; FontPosture fontPos12 = (ch_Italicval.isSelected()) ? FontPosture.ITALIC : FontPosture.REGULAR; String fontFami12 = cb_Families.getValue(); double si12 = comhs.getValue(); t123.setFont(Font.font(fontFami12, fontWeight12, fontPos12, si12)); } private Integer[] getsizesval() { Integer[] sizesval = new Integer[100]; for (int k1 = 0; k1

I need help finishing this code. I need to remove the different fonts and added the authors listed along with there quotes. Please keep the font size and the 2 different checkboxes.

Write a program that can dynamically change the quote by an author and font of this quote (displayed using a label) displayed on a stack pane. The text can be displayed in bold and italic at the same time. You can select the quote text or font size from combo boxes, as shown in the Figure below. The font weight and OLDITALIC) can be selected from the checkboxes at the bottom of the pane. The available list of authors for the combo box and its associated quote for the Label text in the Stack Pane can be obtained from the list below. The combo box for the font size is initialized with numbers from 1 to 100 Author Quote Albert Einstein The only thing that interferes with my learning is my education Pablo Picasso I'd like to live like a poor man only with lots of money Democracy is the process by which people choose the man who'll get the Bertrand Russell blame Henry Ford Nothing is particularly hard if you divide it into small jobs. Homer Simpson Operator! Give me the number for 911 You will need the following components for this Problem: l. Border pane to anchor all the elements 10% 2. StackPane, in the center that has a Label as its node. This Label should display the quote by the selected author. Set its initial text to display the quote by the author listed first in your ComboBox. The weight, posture, size, of the text should be set as default -20% 3. 2 combo boxes at the top of the border pane 40% a. Author use the list above. When an author is selected from this box, their associated quote should be displayed in the StackPane in the center. b. Font Size ComboBox with values from 1-100. when a size is selected, it should set the font property of the label in the StackPane 4. 2 checkboxes at the bottom of the BorderPane 20% a. CheckBox for setting the weight of the label in the StackPane (Bold or Normal) b. CheckBox for setting posture of the labelatalic or Regular) 5. Include proper documentation in your code and submit 3 screenshots of the output window with different combinations of selections 10% Font Sire 24 I like to live like a poor man-only with lots of money

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions