question archive Write a program that contains two frames

Write a program that contains two frames

Subject:Computer SciencePrice: Bought3

Write a program that contains two frames. The first frame NumberView has 3 labels (of your choice) and 3 text fields with numbers and button "update". The second frame GraphView shows a simple "bar graph" - 3 rectangles next to each other. Rectangles should have different colors with height proportional to their values in the first frame. (From the mockup Red bar is of high 10 * n, Green bar is of high 2 * n, and Blue bar is of high 6 *n where n is just some number to scale the high of the rectangles to look bigger) When the user edits one of the numbers in the first frame NumberView, the graph in the second frame GraphView should be redrawn. Use the observer pattern. Store the data (numbers) in a model. Attach the graph view as a listener to the model (observer pattern). When a number is updated, the Number view should update the model, and the model should tell the graph view that a change has occured. As a result, the graph view should repaint itself. You should have at least these 4 classes: - NumberView - GraphView - Model (or another name like Numbers) - Tester (or another name) that has method main and initializes object of NumberView, GraphView and Model and attaches GraphView to the Model object.

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions