SlideShare a Scribd company logo
1
2
 Savita is a programmer at Avon Shoe
Factory. She has created the following
GUI in NetBeans.
3
4
i. When calculate buttonis clickedthe amount should be
displayedinfront of eachitemand total item.
CODING:
private voidjButton1ActionPerformed(java.awt.event.ActionEventevt) {
intsho, san , sli;
sho=Integer.parseInt(esh.getText());
san=Integer.parseInt(esa.getText());
sli=Integer.parseInt(esl.getText());
intshoe , sand, slip, tamn;
ash.setEditable(false);
asl.setEditable(false);
asa.setEditable(false);
tamnt.setEditable(false);
if(sh.isSelected()==true &&sa.isSelected()==false&&sl.isSelected()==false)
{
shoe=sho*1500;
sand=san*0;
slip=sli*0;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
}
else if(sh.isSelected()==false &&sa.isSelected()==true && sl.isSelected()==false)
{
shoe=sho*0;
sand=san*500;
slip=sli*0;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
}
else if(sh.isSelected()==false &&sa.isSelected()==false&&sl.isSelected()==true)
{
shoe=sho*0;
sand=san*0;
slip=sli*500;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
5
}
else if(sh.isSelected()==true &&sa.isSelected()==true &&sl.isSelected()==false)
{
shoe=sho*1500;
sand=san*500;
slip=sli*0;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
}
else if(sh.isSelected()==false &&sa.isSelected()==true &&sl.isSelected()==true)
{
shoe=sho*0;
sand=san*500;
slip=sli*500;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
}
else if(sh.isSelected()==true &&sa.isSelected()==false&&sl.isSelected()==true)
{
shoe=sho*1500;
sand=san*0;
slip=sli*500;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
}
else if(sh.isSelected()==true &&sa.isSelected()==true &&sl.isSelected()==true)
{
shoe=sho*1500;
sand=san*500;
slip=sli*500;
tamn=shoe+sand+slip;
ash.setText(""+shoe);
asa.setText(""+sand);
asl.setText(""+slip);
tamnt.setText(""+tamn);
}
}
6
ii. When Clear buttonis clickedall text fieldandcheckboxes
shouldbe cleared.
Coding:
ash.setEditable(false);
asl.setEditable(false);
asa.setEditable(false);
tamnt.setEditable(false);
esh.setText("");
esl.setText("");
esa.setText("");
ash.setText("");
asl.setText("");
asa.setText("");
tamnt.setText("");
sh.setSelected(false);
sl.setSelected(false);
sa.setSelected(false);
iii. When Stopbuttonis clickedthe applicationshouldclose.
Coding:
System.exit(0);
7
 Koshin is a programmer at Computers
Ltd.To calculate salary to be paid to
teachers she has developed.
The following GUI in NetBeans :
8
I. What shouldbe done sothat only one of the radio buttons
(Male and Female) can be selectedat a time?
Ans. Both the radio button should be put in a button group.
II. Write code todo the Following:
a) Calculate and display the total wages in the
corresponding label whenthe Calculate Salary buttonis
pressed.
Coding:
private voidjButton1ActionPerformed(java.awt.event.ActionEventevt) {
intsalary, nday, tsal;
sal.setEditable(false);
if(mal.isSelected())
{
salary=1000;
}
else
salary=2000;
if(skil.isSelected())
salary+=500;
nday=Integer.parseInt(wor.getText());
tsal=nday*salary;
sal.setText(""+tsal);
}
b) Clear the name and no. of days workedtext fields.
CODING:
private voidjButton2ActionPerformed(java.awt.event.ActionEventevt) {
nam.setText("");
wor.setText("");
}
9
c) Close the applications whenthe STOP buttonis pressed.
CODING:
private voidjButton3ActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0);
}
10
 Mr Kapoor is a programmer ateducation
enterprises. Hecreated the following GUI in
NetBeans . Help him To write code for the
following:
11
a. To display series of oddor evennumbers (depending on first
number is evenor odd) in the jTextArea onthe click of
command button.
Coding:
private voidjButton3ActionPerformed(java.awt.event.ActionEventevt) {
intfn, ln ;
fn=Integer.parseInt(fno.getText());
ln=Integer.parseInt(lno.getText());
for(inti=fn;i<=ln;i=i+2)
{
series.append(""+i + "n");
}
}
b. To clear boththe text fields andtext area, on clicking [Reset]
button.
private voidjButton2ActionPerformed(java.awt.event.ActionEventevt) {
fno.setText("");
lno.setText("");
series.setText("");
}
c. To terminate the applicationonthe click of[stop]button.
private voidjButton1ActionPerformed(java.awt.event.ActionEventevt) {
System.exit(0);
}

More Related Content

More from HimanshiSingh71 (13)

RFID Technology - Electronics and Communication Seminar Topic
RFID Technology - Electronics and Communication Seminar TopicRFID Technology - Electronics and Communication Seminar Topic
RFID Technology - Electronics and Communication Seminar Topic
HimanshiSingh71
 
Automatic Car Number Plate Detection and Recognition using MATLAB
Automatic Car Number Plate Detection and Recognition using MATLABAutomatic Car Number Plate Detection and Recognition using MATLAB
Automatic Car Number Plate Detection and Recognition using MATLAB
HimanshiSingh71
 
Object Oriented Programming in Java
Object Oriented Programming in JavaObject Oriented Programming in Java
Object Oriented Programming in Java
HimanshiSingh71
 
Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)
HimanshiSingh71
 
E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT
HimanshiSingh71
 
Training Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITEDTraining Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITED
HimanshiSingh71
 
JAVA Program in NetBeans
JAVA Program in NetBeansJAVA Program in NetBeans
JAVA Program in NetBeans
HimanshiSingh71
 
One table MySQL queries
One table MySQL queriesOne table MySQL queries
One table MySQL queries
HimanshiSingh71
 
Mysql two table queries
Mysql two table queriesMysql two table queries
Mysql two table queries
HimanshiSingh71
 
JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)
HimanshiSingh71
 
Child Labour in India
Child Labour in India Child Labour in India
Child Labour in India
HimanshiSingh71
 
Airline reservation project using JAVA in NetBeans IDE
Airline reservation project using JAVA in NetBeans IDEAirline reservation project using JAVA in NetBeans IDE
Airline reservation project using JAVA in NetBeans IDE
HimanshiSingh71
 
Automatic street light using LDR and Transistor
Automatic street light using LDR  and TransistorAutomatic street light using LDR  and Transistor
Automatic street light using LDR and Transistor
HimanshiSingh71
 
RFID Technology - Electronics and Communication Seminar Topic
RFID Technology - Electronics and Communication Seminar TopicRFID Technology - Electronics and Communication Seminar Topic
RFID Technology - Electronics and Communication Seminar Topic
HimanshiSingh71
 
Automatic Car Number Plate Detection and Recognition using MATLAB
Automatic Car Number Plate Detection and Recognition using MATLABAutomatic Car Number Plate Detection and Recognition using MATLAB
Automatic Car Number Plate Detection and Recognition using MATLAB
HimanshiSingh71
 
Object Oriented Programming in Java
Object Oriented Programming in JavaObject Oriented Programming in Java
Object Oriented Programming in Java
HimanshiSingh71
 
Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)Global Earthquake Monitor (Real Time)
Global Earthquake Monitor (Real Time)
HimanshiSingh71
 
E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT E1 LINK IS EUROPEAN FORMAT
E1 LINK IS EUROPEAN FORMAT
HimanshiSingh71
 
Training Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITEDTraining Report BHARAT ELECTRONICS LIMITED
Training Report BHARAT ELECTRONICS LIMITED
HimanshiSingh71
 
JAVA Program in NetBeans
JAVA Program in NetBeansJAVA Program in NetBeans
JAVA Program in NetBeans
HimanshiSingh71
 
JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)JDBC (JAVA Database Connectivity)
JDBC (JAVA Database Connectivity)
HimanshiSingh71
 
Airline reservation project using JAVA in NetBeans IDE
Airline reservation project using JAVA in NetBeans IDEAirline reservation project using JAVA in NetBeans IDE
Airline reservation project using JAVA in NetBeans IDE
HimanshiSingh71
 
Automatic street light using LDR and Transistor
Automatic street light using LDR  and TransistorAutomatic street light using LDR  and Transistor
Automatic street light using LDR and Transistor
HimanshiSingh71
 

Recently uploaded (20)

Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
BUSINESS QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 9 SEPTEMBER 2024
Quiz Club of PSG College of Arts & Science
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17Different pricelists for different shops in odoo Point of Sale in Odoo 17
Different pricelists for different shops in odoo Point of Sale in Odoo 17
Celine George
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Exploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle SchoolExploring Ocean Floor Features for Middle School
Exploring Ocean Floor Features for Middle School
Marie
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Respiratory System , Urinary System
Respiratory  System , Urinary SystemRespiratory  System , Urinary System
Respiratory System , Urinary System
RushiMandali
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Hemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptxHemiptera & Neuroptera: Insect Diversity.pptx
Hemiptera & Neuroptera: Insect Diversity.pptx
Arshad Shaikh
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big CycleRay Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Capitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptxCapitol Doctoral Presentation -June 2025.pptx
Capitol Doctoral Presentation -June 2025.pptx
CapitolTechU
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptxAnalysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
Ad

Java Based Case Study program Solved Question

  • 1. 1
  • 2. 2  Savita is a programmer at Avon Shoe Factory. She has created the following GUI in NetBeans.
  • 3. 3
  • 4. 4 i. When calculate buttonis clickedthe amount should be displayedinfront of eachitemand total item. CODING: private voidjButton1ActionPerformed(java.awt.event.ActionEventevt) { intsho, san , sli; sho=Integer.parseInt(esh.getText()); san=Integer.parseInt(esa.getText()); sli=Integer.parseInt(esl.getText()); intshoe , sand, slip, tamn; ash.setEditable(false); asl.setEditable(false); asa.setEditable(false); tamnt.setEditable(false); if(sh.isSelected()==true &&sa.isSelected()==false&&sl.isSelected()==false) { shoe=sho*1500; sand=san*0; slip=sli*0; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn); } else if(sh.isSelected()==false &&sa.isSelected()==true && sl.isSelected()==false) { shoe=sho*0; sand=san*500; slip=sli*0; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn); } else if(sh.isSelected()==false &&sa.isSelected()==false&&sl.isSelected()==true) { shoe=sho*0; sand=san*0; slip=sli*500; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn);
  • 5. 5 } else if(sh.isSelected()==true &&sa.isSelected()==true &&sl.isSelected()==false) { shoe=sho*1500; sand=san*500; slip=sli*0; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn); } else if(sh.isSelected()==false &&sa.isSelected()==true &&sl.isSelected()==true) { shoe=sho*0; sand=san*500; slip=sli*500; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn); } else if(sh.isSelected()==true &&sa.isSelected()==false&&sl.isSelected()==true) { shoe=sho*1500; sand=san*0; slip=sli*500; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn); } else if(sh.isSelected()==true &&sa.isSelected()==true &&sl.isSelected()==true) { shoe=sho*1500; sand=san*500; slip=sli*500; tamn=shoe+sand+slip; ash.setText(""+shoe); asa.setText(""+sand); asl.setText(""+slip); tamnt.setText(""+tamn); } }
  • 6. 6 ii. When Clear buttonis clickedall text fieldandcheckboxes shouldbe cleared. Coding: ash.setEditable(false); asl.setEditable(false); asa.setEditable(false); tamnt.setEditable(false); esh.setText(""); esl.setText(""); esa.setText(""); ash.setText(""); asl.setText(""); asa.setText(""); tamnt.setText(""); sh.setSelected(false); sl.setSelected(false); sa.setSelected(false); iii. When Stopbuttonis clickedthe applicationshouldclose. Coding: System.exit(0);
  • 7. 7  Koshin is a programmer at Computers Ltd.To calculate salary to be paid to teachers she has developed. The following GUI in NetBeans :
  • 8. 8 I. What shouldbe done sothat only one of the radio buttons (Male and Female) can be selectedat a time? Ans. Both the radio button should be put in a button group. II. Write code todo the Following: a) Calculate and display the total wages in the corresponding label whenthe Calculate Salary buttonis pressed. Coding: private voidjButton1ActionPerformed(java.awt.event.ActionEventevt) { intsalary, nday, tsal; sal.setEditable(false); if(mal.isSelected()) { salary=1000; } else salary=2000; if(skil.isSelected()) salary+=500; nday=Integer.parseInt(wor.getText()); tsal=nday*salary; sal.setText(""+tsal); } b) Clear the name and no. of days workedtext fields. CODING: private voidjButton2ActionPerformed(java.awt.event.ActionEventevt) { nam.setText(""); wor.setText(""); }
  • 9. 9 c) Close the applications whenthe STOP buttonis pressed. CODING: private voidjButton3ActionPerformed(java.awt.event.ActionEventevt) { System.exit(0); }
  • 10. 10  Mr Kapoor is a programmer ateducation enterprises. Hecreated the following GUI in NetBeans . Help him To write code for the following:
  • 11. 11 a. To display series of oddor evennumbers (depending on first number is evenor odd) in the jTextArea onthe click of command button. Coding: private voidjButton3ActionPerformed(java.awt.event.ActionEventevt) { intfn, ln ; fn=Integer.parseInt(fno.getText()); ln=Integer.parseInt(lno.getText()); for(inti=fn;i<=ln;i=i+2) { series.append(""+i + "n"); } } b. To clear boththe text fields andtext area, on clicking [Reset] button. private voidjButton2ActionPerformed(java.awt.event.ActionEventevt) { fno.setText(""); lno.setText(""); series.setText(""); } c. To terminate the applicationonthe click of[stop]button. private voidjButton1ActionPerformed(java.awt.event.ActionEventevt) { System.exit(0); }