Make a fourth button called special

Assignment Help JAVA Programming
Reference no: EM13164599

1. Write a GUI application in Java using Swing that has three buttons and a drawing area.

2. Give the window an initial size of 500 x 500 pixels, and put your name in the menu bar.

3. The buttons should be at the bottom of the window and be labeled "Name", "Oval" and "Rectangle".

4. The drawing area should cover the remainder of the window.

5. When it starts, the program should show nothing in the drawing area.

6. Pressing one of the buttons must toggle (turn on or off) the display of one of three things, any or all of which must be viewable simultaneously.

1. Pressing "Name" should toggle the display of your name.

2. Pressing "Oval" should toggle drawing an oval centered on the window.

3. Pressing "Rectangle" should toggle drawing a rectangle centered on the window. The rectangle and oval should not be filled, so that all three things can be seen.

7. When drawn, each of the items should be a different color of your choice.

8. When the user resizes the window, the displayed items must stay at the center of the drawing area.

9. When the program displays an oval or a rectangle, it must draw the figure with 3/4 the width and height of the display area, resizing it when the window gets resized. The text does not have to resize, but must remain in the center of the window.

10. (Optional) Make a fourth button called "special" that does something else notdescribed in the assignment, such as change the background color.

Reference no: EM13164599

Questions Cloud

Design a program that extends the definition of the class : Design a program that extends the definition of the class JFrame to display a window on the screen. Name your class PropertyTax1, title your window "Calculation of Property Taxes," set the window's width to 400 pixels and height to 300 pixels, and te..
Program to keep track of the participants in a triathlon : Create a program to keep track of the participants in a triathlon. Your program will keep track of the times in three events: Running, Swimming, and Biking. Your program will calculate who is the winner in the Male category and the Female category..
Write an abstract class carbon footprint : Using an abstract class with only pure virtual functions, create three small classes unrelated by inheritance---clases Building, Car and Bicycle.
Calculate the geometric mean of numbers : Write a program to calculate the geometric mean of numbers entered by a user. The program should prompt the user to enter numbers and continue to accept the numbers until the user enters 999.
Make a fourth button called special : Make a fourth button called "special" that does something else notdescribed in the assignment, such as change the background color.
Write a c function called values that returns void : Write a C function called values that returns void and takes two double precision arguments (called a and b) and one double precision array argument.
Trojan horse defense : Using your favorite search engine, look up "Trojan Horse Defense". How can it be used to question the conclusions drawn from a forensic investigation? Site a case where it was used.
Write a java program that uses a search tree of strings : Write a Java program that uses a search tree of strings to sort text lines in alphabetic order. You may choose how you de?ne alphabetic order as long as there is some sense in the de?nition. You may also choose what kind of tree you use.
Fragmentation on a storage device : Fragmentation on a storage device could be eliminated by re-compaction of the information. Typical disk devices do not have relocation or base registers (such as are used when memory is to be compacted)

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a complete java program assuming that the variables gp

Write a complete java program Assuming that the variables gpa, deanList and studentName have been declared, you should read in the studentName and gpa from keyboard. Write an if statement that adds 1 to deansList and prints studentName to the standar..

  Java program to store temperatures in two-dimensional array

Write the Java program which uses two-dimensional array to store highest and lowest temperatures for each month of the year. Program must output average high,average low,

  Java threads

This is an introductory assignment on Java synchronization. You will use Java Threads while learning more about concurrency and achieving atomicity using Java’s inbuilt mechanisms.

  Java program editing

Prompt the user for the student's score and put that value into an object

  Write a java loop

write a java loop ( of your choice ) that produces exactly the following output to the screen: 2-4-6-8-

  Prompts the user for three first names

Write an application that prompts the user for three first names and concatenates them in every possible two-name combination so that new parents can easily compare them to find the most pleasing baby name. Save the file as BabyNameComparison.java

  Construct a bulls and cows program for my intro java class

construct a Bulls and Cows program for my intro Java class. This program needs to perform the basic functions of the game (determining how many cows there are and how many bulls there are and tell the player when they win), but it also needs to offer..

  What makes a program easy to modify

Describe the order of magnitude of the code section using Big(O) notation and Explain the relationship between dynamic storage allocation and recursion.

  The string class and/or the stringbuffer class in java

Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Accepts a binary number from the user

Write a Java test program that accepts a binary number from the user. You should store the binary number in a String. Your program should then use afor loop to sequence through every character in the String, counting the number of ones, zeros, and..

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Write methods in java

1. int countVowels (String s) That for a given string s, return number of vowels in s.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd