Write a Java applet that draws a rectangle or an oval based on the width and height given by the user. Provide two text fields for the user to enter the object width and height. The program will have two buttons labeled ‚??Rectangle‚?? and ‚??Oval‚?? which let the user to click to produce the respective shapes. Use the Graphics class components to draw the shapes on a JPanel object while the text fields and buttons should be laid out on another two panels. The panel that contains all the GUI components and the JPanel for the drawing should be separated in different classes, while the applet that invokes this panel should be in another class.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.