Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1)Design a GUI with a frame, three text fields, four radio buttons, and a label (for the equal sign) as follows. Write a program such

1)Design a GUI with a frame, three text fields, four radio buttons, and a label (for the equal sign) as follows. Write a program such that if the user enters two Integers on the text fields and click on any radio buttons the result of the operation appears in the third text field. Note that there is no command button here (after entering integer data on text field one and field two, click on the radio button for +, sum will appear on text field three. And so for the other operations.)

image text in transcribed

For the following cases you must display a dialog box with an appropriate message:

1. One or both text fields are empty or contain non numerical strings, and the user clicks on one of the radio buttons.

2. When division by zero happens.

Hint: You need to convert the content of both text fields to integer by using Integer class. It is at the above cases an exception must happen (need try-catch block) and your program must issues an error message by a dialog box.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions