EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
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
Subject Name: Advanced Object-Oriented Programming
2. 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"
Create an infinite animation of an element moving in a square pattern.
Write a CSS rule that changes the color of all elements containing attribute class = "green-Move" to green and shifts them down 25 pixels and right 15 pixels.
3. When the user hovers over an image, the size of the image should increase by 20%. Create a transformation program that includes four images.
Java Question - Create a GUI-based Java application that uses three JLabel, threeJTextFields, and one JButton control to build a GUI “form”, as shown in the attached picture. Set the background color of the form to “pink”. Makesure the output looks similar to the picture. [Note: Be sure to use input and output dialog boxes]. Thank you.
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
- Part-4: Java FX Create a JavaFX project that demonstrates various topics you have learned like, creating the structure of JavaFx, Panes, UI Controls, Shapes, and events-driven programming for different controls. To do this, use the classes from Part-2. Create a window that consists of the following: • Window title: “Title of your project”. • Design your window by using different User Interface Control like Text Field, Labels, Checkbox / Radio button, Combo box, List box, etc.... Use the data fields from the part-2, to design the nodes of the window. (Minimum five different user interface controls should be used. • Use the concept of Events Driven Programming (EDP) in order to activate the following GUI components (Buttons, radio buttons, check box, etc..) to activate the events to some nodes in your window to implement actions. (Minimum three different events should be created) Include the below in your project report: • Screenshots of all output generated from the application. • Code…arrow_forwardSuppose a GUI has a text field where use can add data in the form of paragraphs. The GUI also contains a button component which when clicked counts the unique number of words in the data provided in the text field and displays the total count in the same text field but this time the text field is read-only. Provide the code for the JButton component.arrow_forwardProject 18-1: Right Triangle Calculator Create a GUI program that calculates the hypotenuse of a right triangle after the user enters the lengths of the two short sides and clicks the Calculate button. GUI Right Triangle Calculator Side A: 100 Side B: 100 Side C: 141.421 Calculate a OX Exit Specifications • Use the Pythagorean Theorem to calculate the length of the third side. The Pythagorean Theorem states that the square of the hypotenuse of a right-triangle is equal to the sum of the squares of the opposite sides: c²=a² + b² b As a result, you can calculate side C like this: c = square_root (a² + b²) Side C should be rounded to a maximum of 3 decimal places. • Make sure the user enters valid int values, and display any data validation messages in a message box.arrow_forward
- Design a quiz interface showing - In this project, you must develop a web page that contains various multiple-choice alternatives with four options, as well as the quiz's result, which will be presented after the user submits the test. However, each option should be javascript validated.arrow_forwardPart-4: Java FX Create a JavaFx project that demonstrates various topics you have learnt like, creating structure of JavaFx, Panes, UI Controls, Shapes and events-driven programming for different controls. To do this, use the classes from Part-2. Create a window that consists of the following: Window title: "Title of your project". • Design your window by using different User Interface Control like Text Field, Labels, Checkbox / Radio button, Combo box, List box, etc. Use the data fields from the part-2, to design the nodes of the window. (Minimum five different user interface controls should be used. • Use the concept of the Events Driven Programming (EDP) in order to activate the following GUI components (Buttons, radio buttons, check box, etc.) to activate the events to some nodes in your window to implement actions. (Minimum three different events should be created) Include the below in your project report: • Screenshots of all output generated from the application. • Code for all…arrow_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_forward
- Don't Copy and paste answer from other websites CHAT Application Note: You must use Java FX GUIs!!!! DO NOT use SWING GUIs. Build a CHAT program, similar to a text-messaging app, to send text messages back and forth. That is you will build 2 programs, a client(ChatClient.java) and a server(ChatServer.java). If you enter a String on the Server and send it to the Client, the Client will display the Message it received. You will need to build a Java FX Gui for this project….you will also need to use Sockets to send the text across the network…..and I would also use Threads…..the new Thread you make will wait for data to come in and display it in the GUI TextArea. The GUI: Both the server program and the Client Program will have the exact same GUI. The both will have a TextArea at the top(To display incoming messages), a TextField at the bottom(for sending messages), and also a Send Button(event to send the data from the Textfield down the network). When the user types in some text in the…arrow_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 " Please add a picture of the outputarrow_forwardUsing java swing framework your interface, provide a label and 4 buttons. Initially, your label will display number 0. Use one button to change the display value in increment of 1, and another button to change the display value in decrement of 1. Add two buttons to increase and decrease the font size of the label.arrow_forward
- Hands-On Project 1-3In this project, you will explore how to write text to a specific element in your web page in response to theonclick event handler. To complete the exercise, you will apply the following JavaScript expression:document.getElementById('id').innerHTML = 'text';where id is the value of the id attribute for the page element and text is the text of the content to be writteninto the element. You will use this expression to enhance a web form by displaying the message “Thank you foryour order” when the user clicks the Submit button. Figure 1-25 shows the completed web page.Do the following:1. Use your code editor to open project01-03_txt.html from the HandsOnProject_01 folder. Enter your name and the date in the comment section of the document and save it as project01-03.html.2. Scroll down to the bottom of the file and locate the input element for the Submit button.3. Add an onclick event handler to the <input> tag that changes the innerHTML value of the page element…arrow_forwardGetting Bigger.pdf PDF O File | C:/Users/19377/Downloads/Getting%20Bigger.pdf + Purpose To review more advanced aspects of user interfaces and event handlers Directions Create an interface for a program that looks like the one in the first image below. Then add an event handler to the JSlider that changes the font size of the text in the JTextArea according to the value on the slider, as illustrated in the second image. Note: These directions are intentionally vague. Use the internet and whatever other resources you have available to try to piece together how to do this. Be sure to cite any sources you use as comments in your code. Text Decorator Type here.. Font Size: 25 50 75 100 Text Decorator Type here... Туре Font Size: 25 50 75 100 11:35 AM e Type here to search 28°F Cloudy 2/23/2022 (8)arrow_forwarduse java GUI The form should contain five command buttons, two labels only, and three picture boxes. The three picture boxes, each containing a flag, are on top of one another, but only one should be visible at a time. For each picture box: Be sure to add the image as a local resource. Set the Size property to 100, 50 Click the Size Mode list arrow, then click StretchImage in the list. For the Labels: One label will have your name as the programmer – see bottom left corner of the windows above. The other label will be used to display the name of the capital city. When a country button is clicked assign the name of the city into this label.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