Please refer to the following UML diagrams:

PanelRaduis extends JPanel

- label: JLabel
- textField: JTextField
+ PanelRadius()
+ getRadius()

PanelCircle extends JPanel

- radius: int
- rgb: int
+ PanelCircle()
+ setRadius(int): void
+ setRGB(int): void
+ setRadiusAndRGB(int, int): void
+ paintComponent(Graphics): void

PanelRGB extends JPanel implements ActionListener

- label: JLabel
- textField: JTextField
- enter: JButton
- rgb: int
- pr: PanelRadius
- pc: PanelCircle
+ PanelRGB(PanelRadius, PanelCircle)
+ actionPerformed(ActionEvent e)

The driven class is given as:

import javax.swing.*;
import java.awt.*;
public class DisplayWindow
{
public static void main(String[] args)
{
JFrame w1 = new JFrame("Display Window");
w1.setLayout(new GridLayout(3,1));
PanelRaduis myPanel = new PanelRaduis();
PanelCircle panel3 = new PanelCircle();
w1.add(myPanel);
PanelRGB yourPanel = new PanelRGB(myPanel,panel3);
w1.add(yourPanel);
w1.add(panel3);
w1.setSize(500, 800);
w1.setVisible(true);
w1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

Please implement all the 3 classes to ensure the application working.

The expected result is shown as the image at the end of this document.

The user is asked to provide an integer value for Raduis, and an integer value for RGB. A Circle will be drawn when "Enter" clicked. see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.