EBK JAVA PROGRAMMING
8th Edition
ISBN: 9781305480537
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 15, Problem 6PE
Program Plan Intro
The variables used in the program are given below:
- ingredients: ChoiceBox
variable to represent the choice box for selecting ingredients. - breadChoiceBox: ChoiceBox
variable to represent the choice box for selecting the type of bread. - button: Button variable to represent the "Order" button.
- label: Label variable to display the total price.
- vBox: VBox variable to create a vertical layout container for the choice boxes, buttons, and labels.
- root: StackPane variable to create a stack pane as the root container for the scene.
- scene: Scene variable to represent the JavaFX scene.
The methods used in the program are as follows:
- main(String[] args): The main method, which serves as the entry point for the JavaFX application.
- start(Stage primaryStage): The start method, which is overridden from the Application class. It sets up the JavaFX application by creating and configuring the UI elements, such as choice boxes, buttons, labels, and layout containers. It also sets the scene and applies the CSS style. This method is automatically called when the application is launched.
Program Description:
To design a JavaFX application for the Sublime Sandwich Shop. Include the CSS file which is used to design an interface reflecting the business.Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
For this task, you need to develop a JavaFX application in NetBeans that implements a LinkedHashMap class. The Java application should consist of a graphical user interface that can be used to add elements to the LinkedHashMap. There should be two TextFields to take in the element name and number. Then there should be four buttons to do four tasks, namely: add, change, remove and show all elements in the LinkedHashMap.
Your buttons should have Action methods and should make use of methods in the LinkedHashMap class.When the Add button is clicked, the element name and value should be added to the LinkedHashMap. Make use of the LinkedHashMap methods to add the elements. When the user fills in the element name and number and the Add button is clicked, a message should be displayed in an alert dialog box to the user to inform them of this
If no element is specified at the time the Add button is clicked, an error message should be displayed to inform the user to enter the element
Please rewrite all of this animation code so that it performs the same functions in a java file instead of the files .css,.js, and .html (which is what I have) in visual studios. You would need to import javaFX since this would require GUI. My styles.css and Animation.html are attached as screenshots, and my script.js is below:
script.js
const dialogue = [
{ character: 'Narrator', text: "In the dead of night, beneath a moon veiled by misty clouds, a lone figure trudged along a desolate forest path." },
{ character: 'Narrator', text: "Unknown to her, she was not alone." },
{ character: 'Human', text: "Who's there? Show yourself!" },
{ character: 'Creature', text: "You venture into realms unknown, mortal. What brings you to these woods?" },
{ character: 'Human', text: "I seek passage to the village beyond. I mean no harm." },
{ character: 'Creature', text: "Harm is but a shadow in these woods, mortal." },
{ character: 'Human', text: "What do you mean? Who are…
1. How would you access the grid property of the parameters object?
parameters.grid
parameters/grid
parameters(grid)
2. What will be displayed in the devtool console after the following is executed?
var a = 200; var b = a--;console.log("b = " + b + " a = " + a);
b = 199 a = 199
b = 200 a = 200
b = 200 a = 199
3. Some users have specific presentation needs based on personal or technological limitations or preferences. Separating content from presentation allows these users the option to control how they view content.
True
False
4. With CSS, you can specifically cater the style to each device to ensure an optimal experience.
True
False
5. Some users have specific presentation needs based on personal or technological limitations or preferences. Separating content from presentation allows these users the option to control how they view content.
True
False
6. With CSS, you can specifically cater the style to each device to ensure an…
Chapter 15 Solutions
EBK JAVA PROGRAMMING
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Create a JavaFX application with at least six labels that contain facts about your favorite topic—for example, the French Revolution or astronomy. Every time the user clicks a Button, remove one of the Labels and add a different one.arrow_forwardCreate a JavaFX application that simulates the rolling of a pair of dice. When the user clicks a button, the application should generate two random numbers, each in the range of 1 through 6, to represent the value of the dice. Use ImageView component to display the dice. (In the Student Sample Programs you will find six images named Die1.png, Die2.png, Die3. png, Die4.png, Die5.png, and Die6.png that you can use in the ImageView components.)arrow_forwardPlease rewrite this animation code below so that it performs the same functions in a java file instead of the files .css,.js, and .html in visual studios. You would need to import javaFX and include your images for creature.png,forestbackground.png,human.png, and human2.png. Also attach a screenshot of the running animation in java. script.js const dialogue = [ { character: 'Narrator', text: "In the dead of night, beneath a moon veiled by misty clouds, a lone figure trudged along a desolate forest path." }, { character: 'Narrator', text: "Unknown to her, she was not alone." }, { character: 'Human', text: "Who's there? Show yourself!" }, { character: 'Creature', text: "You venture into realms unknown, mortal. What brings you to these woods?" }, { character: 'Human', text: "I seek passage to the village beyond. I mean no harm." }, { character: 'Creature', text: "Harm is but a shadow in these woods, mortal." }, { character: 'Human', text: "What do you mean?…arrow_forward
- Write a JAVA GUI code to create the following Use the Suitable layout and panel to show the below described output The Frame is Titled as “MyFrame”. Add the title in the JPanel as Text Area and insert 2 colored radio buttons on selecting each button the color of the frame should change between two colors Add two Text Field by name with title “Me”and “MyFriend” Add Two buttons down which must copy the text from text1 to text 2 on pressing it and the other should clear the content. Names of the Button “Print Text”, “Cancel " Please add a picture of the outputarrow_forwardWrite a JAVA GUI code to create the following Use the Suitable layout and panel to show the below described output The Frame is Titled as “MyFrame”. Add the title in the JPanel as Text Area and insert 2 colored radio buttons on selecting each button the color of the frame should change between two colors Add two Text Field by name with title “Me”and “MyFriend” Add Two buttons down which must copy the text from text1 to text 2 on pressing it and the other should clear the content. Names of the Button “Print Text”, “Cancel”arrow_forwardYou are required to create above frame, Create a class HelloFrame and extend it from JFrame Inside HelloFrame declare 3 textfields for taking string input for name, email and number variables 1 textarea to write a message. Create a button “Submit” which should submit the form. Now create a public constructor for HelloFrame inside which You should call super("Hello Java"); //used to set title of the frame setSize(700, 400); //set length and width of the frame create a label which should display the method "Contact US Panel" similarly create labels for showing name, email, number. Add textfields and button to JFrame. Run the code and make sure the output should be as above frame.arrow_forward
- Write a JFrame that uses two text boxes to accept two integer numbers. When the user clicks the button "Calculate", arithmetic operations can be performed and the results of the operations can be output. the results of the operations are placed in the multi-line text area JTtextArea component. The GUI interface reference is as follows. When doing division, if the remainder is 0, the integer quotient will be displayed, otherwise, a floating point number with two decimal places will be displayed. The output of the programarrow_forwardPlease create the following screen attached using Java GUI (JavaFX): In your code you can add any background of your choosing, but the message and the Cave 1, 2, 3, 4, 5 buttons should look the same. The font is in Arial w/ Choose the Cave being size 36, bolded and white and Cave 1, 2, 3,4,5 are buttons of size 27,bolded and white. Also "Choose a Cave" should appear with a typewriter effect , w/ the same background image. Cave 1, 2, 3, 4, 5, are buttons.arrow_forwardWrite a JFrame that uses two text boxes to accept two integer numbers. When the user clicks the button "Calculate", arithmetic operations can be performed and the results of the operations can be output. the results of the operations are placed in the multi-line text area JTtextArea component. The GUI interface reference is as follows. When doing division, if the remainder is 0, the integer quotient will be displayed, otherwise, a floating point number with two decimal places will be displayed.arrow_forward
- Write a JavaFX application for Lambert’s Vacation Rentals. Use separate ButtonGroups to allow a client to select one of three locations, the number of bedrooms, and whether meals are included in the rental. Assume that the locations are parkside for $600 per week, poolside for $750 per week, or lakeside for $825 per week. Assume that the rentals have one, two, or three bedrooms and that each bedroom more than one adds $75 to the base price. Assume that if meals are added, the price is $200 more per rental.arrow_forwardcreat javaFX 7. Celsius and Fahrenheit Temperature ConverterAssuming that C is a Celsius temperature, the following formula converts the temperatureto Fahrenheit:F 5 1.8 3 C 1 32Assuming that F is a Fahrenheit temperature, the following formula converts the temperature to Celsius:C 5 (5/9) 3 (F 2 32)1044 Chapter 15 Creating GUI Applications with JavaFX and Scene BuilderCreate a JavaFX application that allows the user to enter a temperature. The applicationshould have Button components described as follows:l A button that reads Convert to Fahrenheit. If the user clicks this button, the application should treat the temperature that is entered as a Celsius temperature and convertit to Fahrenheit.l A button that reads Convert to Celsius. If the user clicks this button, the applicationshould treat the temperature that is entered as a Fahrenheit temperature, and convertit to Celsius.arrow_forwardUsing JavaFX with Eclipse or Netbeans, please explain using a main class, controller class, and a FXML... Devise a JavaFX GUI with an internal controller class to maintain an array of arbitrary size. Use a starting default of size 20 and populate it with random data (numbers) initialized into the array. The GUI should be such that users can select and perform the actions listed below. Write methods and select appropriate GUI mechanisms to do the following: 1. Display the contents of the array2. Add a, or a group of numbers to the array at any position.3. Delete a number from the array at any position.4. Sort the array and display the original and sorted forms.5. Display the size of the array.6. Search for a number and its occurrences in the array and flag that number’s position(s) by highlighting it in the display.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Time Complexity Analysis - How To Calculate Running Time | InterviewBit; Author: InterviewBit;https://www.youtube.com/watch?v=--oxG4Q1PA0;License: Standard YouTube License, CC-BY