Question: Instruction:Source.java is required You must run and compile the attachments before attempting the exercises above.Compile and run Appletimport java.awt. * ;import java.applet. * ;import java.awt.event.
Instruction:Source.java is required
You must run and compile the attachments before attempting the exercises above.Compile and run Appletimport java.awt.;import java.applet.;import java.awt.event.;public class prob extends Applet implements ActionListenerLabel greeting new LabelEnter Category ;Font IFont new FontTimesRoman Font.ITALIC, ;Label head new Label SEAT SECTION ;Label head new LabelPRICE PER SEAT";Button submit new ButtonSubmit;Button clear new ButtonClear;TextField category new TextField;TextField name new TextField; TextField cost new TextField;public void initgreetingsetFontIFont;addgreeting;addcategory;addsubmit;addclear;addname;addcost;addhead;addhead; category.addActionListenerthis;category.requestFocus;submit.addActionListenerthis;clear.addActionListenerthis;public void actionPerformedActionEvent thisEventint temp;String catString category.getText;trytemp Integer.parseInt catString ;catch NumberFormatException e temp ;switchtempcase :name.setTextCourtside;costsetText;category.requestFocus;break;case :name.setTextOn The Floor";costsetText;category.requestFocus;break;case :name.setTextThe Perimeter";costsetText;category.requestFocus;break;case :name.setTextUnder The Hoop";costsetText;category.requestFocus;break;case :name.setTextAbove The Rim";costsetText;category.requestFocus;break;case :name.setTextFull Court";costsetText;category.requestFocus;break;case :name.setTextHigh Five";costsetText;category.requestFocus;break;default:name.setTextINVALID;costsetText;category.requestFocus;ifthisEventgetActionCommand "Clear"categorysetText;name.setText;costsetText;category.requestFocus;invalidate;validate;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
