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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

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

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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