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

  Implement a class quiz

Implement a class Quiz that implements the Measurable interface.

  A program that reads a four-digit number from the keyb

Write a program that reads a four-digit number from the keyboard as a string and then converts it into decimal. For example, if the input is 1100, the output should be 12. Hint: Break the string into characters and then convert each character to a va..

  Java program that asks the user for 100 values

Write a Java program that asks the user for 100 values (or generates these randomly) and stores and displays only the distinct values. Hint: use an array to store and display these values.

  The desired functionality is for your programs to input

the desired functionality is for your programs to input pairs of natural numbers as theyre entered by the user until

  Information from the user and prints a payroll statement

Write a program that accepts the following information from the user and prints a payroll statement

  Java program to read line of text which ends with period

Write down the java program which will read the line of text which ends with the period, which serves as sentinel value. Show all the letters which occur in the text.

  Structure named dog with a string field

Create a Structure named dog with a string field for the Dog's name. Create a Structure named Cat with a string field for the Cat's name. Write a program that declares one Dog and one Cat, and assign names to them. Write two overloaded functions n..

  Design a class named large integers

Design a class named largeIntegers such that an object of this class can store an integer of any number of digits.

  Use inheritance to read, store, and print questions for test

use inheritance to read, store, and print questions for a test. First, write an abstract class

  Simple single-server queue has one line of waiting

simple single-server queue has one line of waiting customers and one server who wait on customers. suppose that

  Implement a fishlake simulation similar to the previous

implement a fishlake simulation similar to the previous assignment. you will then make adjustments to accommodate class

  What is overloading and what is overriding

What is overloading and what is overriding? Please use code to explain it.

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