Question

In: Computer Science

write a java program of mickey mouse it can be simple with just ears face eyes...

write a java program of mickey mouse it can be simple with just ears face eyes and mouth

Solutions

Expert Solution

Source Code:

public class Applet extends GP.Containers.Applet
{
    public Applet ()
    {
        // create Mickey parts
        GP.Shapes.Oval face = new GP.Shapes.Oval();
        GP.Shapes.Oval leftEar = new GP.Shapes.Oval();
        GP.Shapes.Oval rightEar = new GP.Shapes.Oval();

        // set position of Mickey parts
        GP.Attributes.Coordinate center = new GP.Attributes.Coordinate(200, 200);
        face.SetPosition(center);
        center = new GP.Attributes.Coordinate(90, 90);
        leftEar.SetPosition(center);
        center = new GP.Attributes.Coordinate(310, 90);
        rightEar.SetPosition(center);

        // ears should be same size, face larger
        GP.Attributes.Dimension size = new GP.Attributes.Dimension(200, 200);
        face.SetSize(size);
        size = new GP.Attributes.Dimension(120, 120);
        leftEar.SetSize(size);
        rightEar.SetSize(size);

        // all parts are the same color
        GP.Attributes.Color color = new GP.Attributes.Colors.Black();
        face.SetColor(color);
        leftEar.SetColor(color);
        rightEar.SetColor(color);
    }
}

Note: If you have any doubts or queries, feel free to ask by commenting down below.

And if my answer suffice to the requirements, then kindly upvote as an appreciation

Happy Learning :)


Related Solutions

I want to write this program in java. Write a simple airline ticket reservation program in...
I want to write this program in java. Write a simple airline ticket reservation program in java.The program should display a menu with the following options: reserve a ticket, cancel a reservation, check whether a ticket is reserved for a particular person, and display the passengers. The information is maintained on an alphabetized linked list of names. In a simpler version of the program, assume that tickets are reserved for only one flight. In a fuller version, place no limit...
Write a program in Java Design and implement simple matrix manipulation techniques program in java. Project...
Write a program in Java Design and implement simple matrix manipulation techniques program in java. Project Details: Your program should use 2D arrays to implement simple matrix operations. Your program should do the following: • Read the number of rows and columns of a matrix M1 from the user. Use an input validation loop to make sure the values are greater than 0. • Read the elements of M1 in row major order • Print M1 to the console; make...
Write a simple java program that produces any text art ("ASCII art") picture. Your program can...
Write a simple java program that produces any text art ("ASCII art") picture. Your program can produce any picture you like, with the following restrictions: • The picture should consist of between 3 and 200 lines of output, with no more than 100 characters per line. • The code must use at least one for loop or static method but should not contain infinite loops.
in a gui ' in java write a program that draws equal a simple fence with...
in a gui ' in java write a program that draws equal a simple fence with vertical, spaced slats backed by two boards. Behind the fence show a simple house support Make sure the in the und. house is visible between the slats in the fence.
Make a java program of Mickey I have the starter program but I need to add...
Make a java program of Mickey I have the starter program but I need to add eyes and a smile to it. import java.awt.Canvas; import java.awt.Color; import java.awt.Graphics; import java.awt.Rectangle; import javax.swing.JFrame; public class Mickey extends Canvas { public static void main(String[] args) { JFrame frame = new JFrame("Mickey Mouse"); Canvas canvas = new Mickey(); canvas.setSize(400, 400); canvas.setBackground(Color.white); frame.add(canvas); frame.pack(); frame.setVisible(true); } public void paint(Graphics g) { Rectangle bb = new Rectangle(100, 100, 200, 200); mickey(g, bb); } public void...
Watch: Mickey Mouse Monopoly After watching the video, you should write one long paragraph summarizes the...
Watch: Mickey Mouse Monopoly After watching the video, you should write one long paragraph summarizes the video and one long paragraph of commentary discussing the video. Your entry should follow this format: Name of Video: Summary: Commentary:
In this question, you are asked to write a simple java program to understand natural language....
In this question, you are asked to write a simple java program to understand natural language. The user will enter the input following the format: Name came to City, Country in Year. For example: Robin came to Montreal, Canada in 2009. Assume a perfect user will follow the exactly above formats for the inputs. Your program should be able to analyze the key words (Name, City, Country and Year) from the inputs and reorganize the outputs following format: Name stay...
I need a java code Write a simple program to prompt the user for a number...
I need a java code Write a simple program to prompt the user for a number between 1 and 12 (inclusive) and print out the corresponding month. For example:   The 12th month is December. Use a java "switch" statement to convert from the number (1-12) to the month. Also use a "do while" loop and conditional checking to validate that the number entered is between 1 and 12 inclusive and if not, prompt the user again until getting the correct...
Write a simple java program to list roman numeral for a given range of numbers. Roman...
Write a simple java program to list roman numeral for a given range of numbers. Roman numerals are represented by seven different symbols: I, V, X, L, C, D, and M. I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000 Roman numerals are usually written largest to smallest from left to right. But a number like 4 is not written as IIII. It is written as IV. Because...
Write a java simple document retrieval program that first asks the user to enter a single...
Write a java simple document retrieval program that first asks the user to enter a single term query, then goes through two docuements named doc1.txt and doc2.txt (provided with assignment7) to find which document is more relevant by calculating the frequency of the query term in each document. Output the conclusion to a file named asmnt7output.txt in the following format (as an example for query “java” and “problem”). The percentages in parenthese are respective supporting frequencies. java: doc1(6.37%) is more...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT