Concept explainers
Suppose you change the order of the drawing commands in Listing 3.6 to the following. Will the gc.setFill picture change? If so. how will it change?
//Draw mouth:
gc.setFill (Color.RED);
gc.strokeArc (X_MOUTCH, Y_MOUTH, MOUTH_WIDTH,
MMOUTH_HEIGHT, MOUTH_START_ANGLE,
MOUTH_EXTENT_ANGLE), ArcType. OPEN;
//Draw face interior and outline:
gc.setFill (Color.YELLOW);
gc.filloval(X_FACE, Y_FACE,
FACE_DIAMETER, FACE_DIAMETER);
gc.setFill (Color.BLACK);
gc.strokeoval (X_FACE, Y_FACE,
FACE_DIAMETER, FACE_DIAMETER);
//Draw eyes:
gc.setFill (Color.BLUE);
gc.fillOval (X_RIGHT_EYE, Y_RIGHT_EYE,
EYE_WIDTH, EYE_HEIGHT);
gc.fillOval (X_LEFT_EYE, Y_LEFT_EYE,
EYE_WIDTH, EYE_HEIGHT);
//Draw nose:
gc.setFill (Color.BLACK);
gc.fillOval(X_NOSE, Y_NOSE,
NOSE_DIAMETER, NOSE_DIAMETER);
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (3rd Edition)
Problem Solving with C++ (9th Edition)
Starting Out with Python (3rd Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (8th Edition)
- 1. Write a program that displays four images along with their label texts in a grid pane, as shown below. You may use the images available in the folder "LabFiles" | Flags Sultanate of Oman Republic of Yemen Kingdom of Saudi Arabia United Arab Emirates Check Point: How the nodes (elements) are arranged in a grid pane? How can you add nodes to the grid pane? 2. Create different versions of this program to test different type of pane layouts.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_forwardchange below code to the example photo page. the photo is just example but the layout should be like that @extends('base') @section('main') <div class="py-12"> <div class="max-w-7xl mx-auto sm:px-6 lg:px-8"> <div class="bg-white overflow-hidden shadow-xl sm:rounded-lg"> <div class="row"> <div class="col-sm-12"> @if(session()->get('success')) <div class="alert alert-success text-center"> {{ session()->get('success') }} </div> @endif </div> <div class="col-sm-12"> <br /> <h3 class="display-5 text-center">Room List</h3> <table class="table table-striped">…arrow_forward
- Change the code so it loads the image from a folder named img instead of a url. .bgimg {background-position: center;background-size: cover;background-image: url("/w3images/coffeehouse.jpg");min-height: 75%;}arrow_forwardFor 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 elementarrow_forwardOBAFGKM are the seven categories that are used to describe the absorption lines of a spectrum. Access the Spectral Types Color Slider by opening the Eclipsing Binary Stars section of the NAAP Labs Application and then the Spectral Types of Stars subsection (it is the last simulation on the page) and use it to complete the data table below. Spectral Type: include a letter and a number (no space). Temperature: Kelvin (K) is assumed for Temperature. Color: choose from Blue, White, Orange, or Red (spelling counts!).arrow_forward
- Flutter: How do I change the Icon image with the other one when I click on it? For instance: I have this code: child: IconButton( icon: Image.asset('assets/images/baguette.png'), iconSize: 150, onPressed: () { openDialog(); }, )) Then the open Dialogue function opens a widget box in a smaller window that has many other icons you can select from? the widget buttons are also implemented IconButton. I want to click on one of the icons in the widget (different dart file) and replace the main Icon that we clicked to open this dialogue to that specific Icon image! I don't know how to go about it. I will appreciate the help.arrow_forwardHow is it decided what image from the ImageList will be shown in the PictureBox, and what value is used to make that decision?arrow_forwardIn Python, create a GUI using Qt to convert a color to its RGB and hex values. More specifically, use a ComboBox widget to allow the user to select a color (as a string.) Once a color has been selected, the GUI will then display the RGB and Hex values. Use a Python dictionary to store the colors and their RGB/Hex values. DO NOT USE ANY PYTHON PACKAGES OR WIDGETS OTHER THAN THOSE THAT HAVE BEEN SPECIFIED IN THESE INSTRUCTIONS.arrow_forward
- Open the HTML and JavaScript files provided as start up files (index.html and navigation.js). Then, run the application and notice that when you click on a link in the sidebar, the page is scrolled so the information for the speaker associated with that link is displayed. In other words, this application works even if JavaScript is disabled. In the JavaScript file, add an event handler for the ready event method. Then, within the function for that event handler, add jQuery code that hides the heading and article for all but the first speaker. Add an event handler for the click event of the <a> elements in the sidebar. Then, within the function for that event handler, add jQuery code that hides all the speaker information, gets the value of the href attribute of the link that was clicked, and then uses that value to display the heading and article for the speaker associated with that link.arrow_forwardWhat does this code look like when you run it? code: import tkinter # Let's create the Tkinter window.window = tkinter.Tk()window.title("GUI") # You will first create a division with the help of Frame class and align them on TOP and BOTTOM with pack() method.top_frame = tkinter.Frame(window).pack()bottom_frame = tkinter.Frame(window).pack(side = "bottom") # Once the frames are created then you are all set to add widgets in both the frames.btn1 = tkinter.Button(top_frame, text = "Button1", fg = "red").pack() #'fg or foreground' is for coloring the contents (buttons) btn2 = tkinter.Button(top_frame, text = "Button2", fg = "green").pack() btn3 = tkinter.Button(bottom_frame, text = "Button3", fg = "purple").pack(side = "left") #'side' is used to left or right align the widgets btn4 = tkinter.Button(bottom_frame, text = "Button4", fg = "orange").pack(side = "left") window.mainloop()arrow_forwardCopy the text below in the text file "words.txt" The JavaFX Group component is a container component which applies no special layout to its children. All child components (nodes) are positioned at 0,0. A JavaFX Group component is typically used to apply some effect or transformation to a set of controls as a whole as a group. If you need some layout to the children inside the Group, nest them inside layout components and add the layout components to the Group. The JavaFX Group component is represented by the class javafx.scene.Group. Finish the implementatio of the methods public static ArrayList<String> read_words(String fname) public static int get_longest(ArrayList<String> data, int n) In the following code import java.util.*; import java.io.*; public class Words { public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList<String> data = read_words("words.txt") ; System.out.println("Size of the…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education