You can set the background color of the Canvas by invoking setBackground: tBackground(Color.white) You can create your own colors by specifying the red, green, and blue ( RGB) components.įor example: Color purple = new Color(128, 0, 128) Įach value is an integer in the range 0 (darkest) to 255 (lightest). Suppose we want to draw a “Hidden Mickey”, which is an icon that represents Mickey Mouse (see ). We can use the oval we just drew as the face, and then add two ears. This program will make use of methods with parameters and return values, How do I add methods to this? /* Daniel Martos To make the code more readable, let’s use Rectangle objects to represent bounding boxes.In my java assignment I created a program that executed what was supposed to happen, but my feedback from my professor was: The main task for this program was for you to learn to create methods however, you did not create any methods in your program. The scanner class, string methods, and nested for Loops. It will then calculate the cost of their tuition and print out the user's User for their full name and the number of credits that they are taking. Set an assignment number, and your credentials (user name, API key) in the line that creates the Bridges object at the beginning of the program. Import the java.util package in order to work with the scanner class. Public static final double PER_CREDIT = 302.
0 Comments
Leave a Reply. |