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.
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.