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 20:00
Need asap write a short paper describing the history and differences between six sigma, waterfall, agile, and scrum models. understanding these models can give you a good idea of how diverse and interesting it development projects can be. describe what the rationale for them is and describe their key features. describe the history behind their development. at least 400 words
Answers: 1
question
Computers and Technology, 24.06.2019 20:10
Approximately what portion of global employers tends to use social media websites to hire new employees?
Answers: 1
question
Computers and Technology, 24.06.2019 21:40
Clunker motors inc. is recalling all vehicles in its extravagant line from model years 1999—2002 as well as all vehicles in its guzzler line from model years 2004—2007. a boolean variable named recalled has been declared. given a variable modelyear and a string modelname, write a statement that assigns true to recalled if the values of modelyear and modelname match the recall details and assigns false otherwise.
Answers: 2
question
Computers and Technology, 25.06.2019 01:30
What was the advantage of using transistors instead of vacuum tubes in the second-generation computers? a. computers were drastically reduced in size. b. computers no longer produced errors. c. computers became affordable. d. computers could run on electricity.
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, 02.01.2020 11:31
Questions on the website: 13722360