subject

Purpose: The lab this week focuses on using some CSS to style an application as well as the Slider and TextArea controls and the FileChooser class. The application will use three Slider controls to change the color of the text in a TextArea control and the FileChooser class to open and save text files. Task: Create a project called ColorControlPanel_FirstName_LastNam e or Lab9_FirstName_LastName. Remember to include comments summarizing the program.
1. Make sure you have imported all of the classes necessary for this application. This program will require Application, Stage, Scene, Button, Label, Slider, FileChooser, TextArea, HBox, VBox, and may require Pos and Insets (depending on how you approach customizing the interface). In addition to these JavaFX imports, you will also need to import Scanner and all classes from the io package. Prepare the program to be executed as a JavaFX application.
2. In the global scope of the class, declare a String variable that will hold the current file path. Initialize this String to "untitled". Make sure both the main and start methods include a throws clause to handle an IOException.
3. For the interface of this application, you will need two Button controls: Open and Save. Additionally, you will need three Slider controls for the red, green, and blue. Lastly, you will need a TextArea control. The title of the application will reflect the file that is currently open. Use the file path String to set the title. Refer to the example near the end of the directions.
4. When the Open button is clicked, the open dialog method of the FileChooser class is called. After a file is selected to open, use the getPath method to get the file path and assign that to the String for the file path. Update the title of the application to indicate the current file path. Update the TextArea to contain the text from the file.
5. When the Save button is clicked, check to see if the file path currently held by the String exists. a. If this file path does exist, write the contents of the TextArea to the file. b. If the file path does not exist, call the save dialog method of the FileChooser class. After a location is selected and a file name is given, use the getPath method to get the file path and assign that to the String for the file path. Update the title of the application to indicate the current file path. Write the contents of the TextArea to the file.
6. Each of the three Slider controls must have a Label indicating the color each affects. The Slider and Label pairs are each placed in an HBox. The three colors are red, green, and blue. The min and max values for the Sliders are 0 and 255, respectively. The initial value is 0. The tick marks are visible. The major ticket unit is 15. The minor tick count is 5. The labels are visible. The slider knob snaps to the closest tick mark. The width of each slider is 512.
7. Add an event listener to each Slider control as a lambda expression. a. Assign the value of each of the three Sliders to three double variables. b. Using inline styling, set the style for the TextArea to change the color of the text. The property-related to text color is -fx-text-fill. You can use the RGB format for setting the color since each Slider holds a decimal value for that color. Keep in mind the following format: -fx-text-fill: RGB(red, green, blue); The red, green, and blue should be replaced with the variables that hold the values of each of the three Sliders. Make sure the Label and Slider are consistent; if you indicate a Slider is for green, that Slider should affect the amount of green in text.
8. Adjust the spacing, alignment, and style of the application

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
My mom and i are moving and we don’t have wifi for the next week, i want to know if using a using a hotspot with unlimited data is better than using regular wifi. i’m considering cost, speed, and data sacrifices.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. which step can possibly increase the severity of an incident? a. separating sensitive data from non-sensitive data b. immediately spreading the news about the incident response plan c. installing new hard disks d. increasing access controls
Answers: 2
question
Computers and Technology, 23.06.2019 20:10
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
Answers: 1
You know the right answer?
Purpose: The lab this week focuses on using some CSS to style an application as well as the Slider a...
Questions
question
Mathematics, 21.11.2020 21:20
question
Mathematics, 21.11.2020 21:20
question
Mathematics, 21.11.2020 21:20
question
Mathematics, 21.11.2020 21:20