Question: Java - Up/Down - Please use WidgetViewer , similar solutions do not. Write a WidgetViewer GUI that has the following widgets: a button labeled go

Java - Up/Down - Please use WidgetViewer, similar solutions do not.

Write a WidgetViewer GUI that has the following widgets:

a button labeled "go up/down"

a label initialized to 0 (we'll call this the left label)

a label initialized to 0 (we'll call this the right label)

a button labeled "go down/up"

When the "go up/down" button is pushed, a random number between 1 and 10 (inclusive) is generated and added to the left label, and another random number between 1 and 10 (inclusive) is generated and subtracted from the right label.

When the "go down/up" button is pushed, a random number between 1 and 10 (inclusive) is generated and subtracted from the left label, and another random number between 1 and 10 (inclusive) is generated and added to the right label.

Grading Elements

The program uses WidgetViewer to provide a GUI environment

The program displays two JButtons and two JLabels, as specified

The program uses one or more event handlers to detect user input and take appropriate action

The program generates two random numbers in the appropriate ranges when a button is clicked

The program manipulates the JLabels as specified based on the buttons clicked by the user

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!