Create a histogram bar

Assignment Help JAVA Programming
Reference no: EM13552114

Recall basic Java coding, including selection, loops, event handling and a little the swing graphics, while manipulating one-dimensional arrays. The picture below demonstrates an example of the user interface during your program's execution.

1261_bar.png

Initially, your program must display a single button with a Set Bar Count label and a text field to its right. The user is expected to type an integer from 1 through 25 in the field and then click the button. Your program should respond by displaying a column of text fields like the five shown on the left. The number of text fields in the column must match the number specified in the top text field, and the window should be resized to match the height of the column. Also, the Update Bars button is added to the window at this time.

Once the column of text fields is displayed, the user is expected to type a non-negative integer into each text field. Finally, the user clicks the Update Bars button at which time your program creates a histogram in which there is a horizontal bar immediately left of each of the text fields in the column. The length of each histogram bar must be directly proportional to the length of the longest bar with the longest bar within one pixel of the right edge of the window.

For example, if a text field contains "2" and the largest text field value is "8", then the bar adjacent to the 2 would extend ¼ of the distance to the edge of the window.

NOTE THAT IF THE USER'S INPUT IS INVALID, THEN THE APPLICATION SHOULD IGNORE THE INPUT AND CHANGE NOTHING.

Reference no: EM13552114

Questions Cloud

Find the relativistic kinetic energy of the electron : An electron is accelerated from rest through a potential difference that has a magnitude of 2.20 × 107 V. The mass of the electron is 9.11 × 10-31 kg, What is the relativistic kinetic energy (in joules) of the electron
What will be speed of the crate at the bottom of the incline : A 40.0 N crate starting at rest slides down a rough 6.0 m long ramp, inclined at 30 degrees with the horizontal. The force of friction between crate and ramp is 6.0 N. What will be the speed of the crate at the bottom of the incline?
The basic process structures to use in manufacturing : The basic process structures to use in manufacturing this new product.
What is the maximum distance will it travel : A spring is compressed by .02 m ad launches a block up an incline (ignore friction). what is the maximum distance will it travel
Create a histogram bar : Demonstrates an example of the user interface during your program's execution
Evaluate the relativistic momentum of the spacecraft : A spacecraft has a nonrelativistic (or classical) momentum whose magnitude is 1.4 × 1013 kg·m/s. Find the relativistic momentum of the spacecraft
A piston-cylinder device contains air : A piston-cylinder device contains air (2kg) at 100kPa and 300K. The air is compressed slowly and frictionless by following a polytropic process with a polytropic exponent of 1.4. The temperature reaches at 360K at the final state.
Obtain how many moles escape when the air is released : A 3000mL flask is initially open to air at 19^C and 1atm pressure. It's then closed and immersed in boiling water. How many moles escape when the air is released
Evaluation of strategic alternatives : Evaluation of Strategic Alternatives: Second Focus Area

Reviews

Write a Review

JAVA Programming Questions & Answers

  1 give the big o for the followinga n2 6n 32b n 6c

1 give the big o for the followinga. n2 6n 32b. n 6c. analyze the code below for integer n

  Write java program to display results in java applet

Write down the java program which displays following results in java applet. Permits the user to enter three numbers (use JOptionPane for this) and prints out average of those value on screen.

  Write applet which reads five numbers-draw equivalent stars

Write the applet which reads five numbers (each between 1 and 30). For each number read, your program must design line containing that number of adjacent asterisks.

  1 linked listsin this problem you will write a class that

1 linked listsin this problem you will write a class that implements an ordered list of strings. your class will able

  Adt for a two color double stack adt consists of two stacks

design an adt for a two color double stack adt that consists of two stacks one red and one blue and has its operations color coded versions of the regular stack adt operations.

  Java program ask user to enter 10-character telephone number

Write a Java program that asks the user to enter a 10-character telephone number in the format XXX-XXX-XXXX. The program should display the telephone number with any alphabetic characters

  Write a program to test your class definition

Do not define an input method. The only method that can set the counter is the one that sets it to zero. Write a program to test your class definition.

  Create to determine how much either joe or jim

What type of equation would you create to determine how much either Joe or Jim makes separately? What equation is needed in Java (ignoring the $ symbol)? What data type is needed need for this equation?

  Write a java class

Write a Java class called PQueue that extends the provided abstract QueueADT class.

  Write a program that prompts for and accepts input of test

write a program that prompts for and accepts input of test ggrades that are integers between 0 and 100. For each numerical test grade,  program should display a corresponding letter grade

  Write java classes for the class diagram

Write Java classes for the class diagram. You don't need to write any set and get methods for simplicity.

  Java :a user-defined starting position (other than 0,0)

modifying the program so that it can start from a user-defined starting position (other than 0,0) and search for a user defined ending point (other than row-1, column-1) .

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