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 class that implements an ordered list of strings

In this problem you will write a class that implements an ordered list of Strings.

  Point of sale terminal

a software implementation of a Point of Sale terminal at a typical store. The users of the system are the cashiers sitting at the sales terminals of the store. The users can use the system to manage sales items in the store, customer details and of c..

  Shows the users name and program name

Java program, the program has a page that shows the users name and program name. a second jpanel that shows 4 buttons (circle square rectangle and oval) the problem i am having is that my program is not dropping where i click and the shapes are not s..

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write specifications for method which advances date by one

Write specifications for the method which advances any given date by one day. Comprise a statement of purpose, pre- and post-conditions, and description of parameters.

  Compute the temperature in centigrade

Compute the temperature in Centigrade - Display the temperatures in both Centrigrade and Fahrenheit with appropriate labels, using the + operator to concatenate the labels with the variables

  Create a bar chart that illustrates sales.

Hal's Used Cars has four salespeople named Pam, Leo, Kim, and Bob. Accept values for the number of cars sold by each salesperson in a month, and create a bar chart that illustrates sales. Save the file as BarGraph.java.

  Write program with jframe to enter series of names

Write a program with JFrame which permits user to enter series of friends' names and phone numbers and creates file from entered data.

  supply a student tester class that tests all methods

Implement a class Student. For the purpose of this exercise, a student has a name and a total quiz score. Supply an appropriate constructor and methods getName( ), addQuiz(int score), getTotalScore( ), and getAverageScore ( ).

  Write a method named is all vowels that returns

Write a method named isAllVowels that returns whether a String consists entirely of vowels

  Develop class which implements interface

Let the ADT called SquareMatrix. (The matrix can be represented by 2-D array of ints w/ n rows and n columns.) Write specification for ADT as Java interface. Develop the class which implements interface.

  Give at least one constructor without any parameter

We learned as popular Set implementation. Write own TreeSet class that implements following interface: You are to give at least one constructor without any parameter.

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