SlideShare a Scribd company logo
Design a Windows Desktop application and write the code that will execute according to the
program requirements in Figure 4-108. Before designing the user interface, create a Use Case
Definition. Before writing the code, create an event-planning document for each event in the
program.
Solution
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.*;
public class IncomeTaxCalculator extends Applet implements ActionListener,WindowListener{
private Label label,label1,label2,label3;
private JTextField txt,txt1,txt3,txt4;
private JButton btn1,btn2;
public void init(){
Frame f=new Frame();
Frame f1=new Frame();
f.setLayout(new BorderLayout());
f.setSize(1000, 300);
Panel p=new Panel();
Panel pc1=new Panel();
f.add(pc1,"South");
f.add(p,"North");
label=new Label("Enter Income :");
label1=new Label("Tax To Be Paid :");
label2=new Label("Cess");
label3=new Label("Income Tax");
txt1=new JTextField(10);
txt3=new JTextField(10);
txt4=new JTextField(10);
txt=new JTextField(10);
p.add(label);
p.add(txt);
p.add(label3);
p.add(txt4);
p.add(label2);
p.add(txt3);
p.add(label1);
p.add(txt1);
btn1= new JButton("SUBMIT");
btn2= new JButton("EXIT");
pc1.add(btn1);
pc1.add(btn2);
f.setVisible(true);
btn1.addActionListener(this);
btn2.addActionListener(this);
}
public static void main(String args[]){
new IncomeTaxCalculator().init();
}
@Override
public void actionPerformed(ActionEvent e) {
JButton btn=(JButton)e.getSource();
if(btn==btn1){
double a=Integer.parseInt(txt.getText());
double tax=0,b=0;
if(a>0 && a<=160000){
txt1.setText("0");
txt4.setText("0");
txt3.setText("0");
}else if(a>160000 && a<=300000){
a=a-160000;
tax=0.1*a;
txt4.setText(String.valueOf(tax));
txt3.setText(String.valueOf(tax*.03));
tax+=tax*.03;
txt1.setText(String.valueOf(tax));
}else if(a>300000 && a<=500000){
a=a-300000;
tax=0.2*a+14000;
txt4.setText(String.valueOf(tax));
txt3.setText(String.valueOf(tax*.03));
tax+=tax*.03;
txt1.setText(String.valueOf(tax));
}else if(a>500000){
a=a-500000;
tax=0.3*a+54000;
txt4.setText(String.valueOf(tax));
txt3.setText(String.valueOf(tax*.03));
tax+=tax*.03;
txt1.setText(String.valueOf(tax));
}
}else if(btn==btn2){
System.exit(0);
}
}
@Override
public void windowActivated(WindowEvent e) {
}
@Override
public void windowClosed(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowOpened(WindowEvent e) {
}
}

More Related Content

Similar to Design a Windows Desktop application and write the code that will exe.pdf

Java awt
Java awtJava awt
Hack2the future Microsoft .NET Gadgeteer
Hack2the future Microsoft .NET GadgeteerHack2the future Microsoft .NET Gadgeteer
Hack2the future Microsoft .NET Gadgeteer
Lee Stott
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
tutorialsruby
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
tutorialsruby
 
Lecture 09 high level language
Lecture 09 high level languageLecture 09 high level language
Lecture 09 high level language
鍾誠 陳鍾誠
 
Advance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWTAdvance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWT
Payal Dungarwal
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
Jiaxuan Lin
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
udit652068
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
nidhileena
 
(java) eclipse PleaseDevelop an application that implements a pro.pdf
(java) eclipse PleaseDevelop an application that implements a pro.pdf(java) eclipse PleaseDevelop an application that implements a pro.pdf
(java) eclipse PleaseDevelop an application that implements a pro.pdf
aroraopticals15
 
Notification android
Notification androidNotification android
Notification android
ksheerod shri toshniwal
 
Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification Tutorial
Ketan Raval
 
Java Programming Projects
Java Programming ProjectsJava Programming Projects
Java Programming Projects
Vijayananda Mohire
 
Java Programming Assignment
Java Programming AssignmentJava Programming Assignment
Java Programming Assignment
Vijayananda Mohire
 
All Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docxAll Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docx
adhitya5119
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
CORE JAVA-2
CORE JAVA-2CORE JAVA-2
Practical
PracticalPractical
Practical
rajesh samata
 
ch20.pptx
ch20.pptxch20.pptx
Controller
ControllerController
Controller
Iniya Kannan
 

Similar to Design a Windows Desktop application and write the code that will exe.pdf (20)

Java awt
Java awtJava awt
Java awt
 
Hack2the future Microsoft .NET Gadgeteer
Hack2the future Microsoft .NET GadgeteerHack2the future Microsoft .NET Gadgeteer
Hack2the future Microsoft .NET Gadgeteer
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
 
GNURAdioDoc-8
GNURAdioDoc-8GNURAdioDoc-8
GNURAdioDoc-8
 
Lecture 09 high level language
Lecture 09 high level languageLecture 09 high level language
Lecture 09 high level language
 
Advance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWTAdvance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWT
 
Developer Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for BeginnersDeveloper Student Clubs NUK - Flutter for Beginners
Developer Student Clubs NUK - Flutter for Beginners
 
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdfWorking with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
Working with Layout Managers. Notes 1. In part 2, note that the Gam.pdf
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
(java) eclipse PleaseDevelop an application that implements a pro.pdf
(java) eclipse PleaseDevelop an application that implements a pro.pdf(java) eclipse PleaseDevelop an application that implements a pro.pdf
(java) eclipse PleaseDevelop an application that implements a pro.pdf
 
Notification android
Notification androidNotification android
Notification android
 
Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification Tutorial
 
Java Programming Projects
Java Programming ProjectsJava Programming Projects
Java Programming Projects
 
Java Programming Assignment
Java Programming AssignmentJava Programming Assignment
Java Programming Assignment
 
All Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docxAll Of My Java Codes With A Sample Output.docx
All Of My Java Codes With A Sample Output.docx
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
CORE JAVA-2
CORE JAVA-2CORE JAVA-2
CORE JAVA-2
 
Practical
PracticalPractical
Practical
 
ch20.pptx
ch20.pptxch20.pptx
ch20.pptx
 
Controller
ControllerController
Controller
 

More from Footageetoffe16

Why did the defendants fight jurisdiction in the United States in th.pdf
Why did the defendants fight jurisdiction in the United States in th.pdfWhy did the defendants fight jurisdiction in the United States in th.pdf
Why did the defendants fight jurisdiction in the United States in th.pdf
Footageetoffe16
 
Why was the frontier important in American historySolutionFro.pdf
Why was the frontier important in American historySolutionFro.pdfWhy was the frontier important in American historySolutionFro.pdf
Why was the frontier important in American historySolutionFro.pdf
Footageetoffe16
 
What is the multiplication principle Also, provide example.Solu.pdf
What is the multiplication principle Also, provide example.Solu.pdfWhat is the multiplication principle Also, provide example.Solu.pdf
What is the multiplication principle Also, provide example.Solu.pdf
Footageetoffe16
 
What were the three primary goals of the FASB in developing the Codi.pdf
What were the three primary goals of the FASB in developing the Codi.pdfWhat were the three primary goals of the FASB in developing the Codi.pdf
What were the three primary goals of the FASB in developing the Codi.pdf
Footageetoffe16
 
What is the difference between public relations and public affairs.pdf
What is the difference between public relations and public affairs.pdfWhat is the difference between public relations and public affairs.pdf
What is the difference between public relations and public affairs.pdf
Footageetoffe16
 
What is Network Chatter and how does it affect performanceSolut.pdf
What is Network Chatter and how does it affect performanceSolut.pdfWhat is Network Chatter and how does it affect performanceSolut.pdf
What is Network Chatter and how does it affect performanceSolut.pdf
Footageetoffe16
 
What are the elements types to add video and audio and give some att.pdf
What are the elements types to add video and audio and give some att.pdfWhat are the elements types to add video and audio and give some att.pdf
What are the elements types to add video and audio and give some att.pdf
Footageetoffe16
 
What are the types of nonverbal communication used by President John.pdf
What are the types of nonverbal communication used by President John.pdfWhat are the types of nonverbal communication used by President John.pdf
What are the types of nonverbal communication used by President John.pdf
Footageetoffe16
 
The owner of a small business is planning on expanding his business. .pdf
The owner of a small business is planning on expanding his business. .pdfThe owner of a small business is planning on expanding his business. .pdf
The owner of a small business is planning on expanding his business. .pdf
Footageetoffe16
 
The government safety net creates an adverse selection problem and m.pdf
The government safety net creates an adverse selection problem and m.pdfThe government safety net creates an adverse selection problem and m.pdf
The government safety net creates an adverse selection problem and m.pdf
Footageetoffe16
 
Syntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdf
Syntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdfSyntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdf
Syntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdf
Footageetoffe16
 
scene from American Samoa Paradise Lost •How does power, both form.pdf
scene from American Samoa Paradise Lost •How does power, both form.pdfscene from American Samoa Paradise Lost •How does power, both form.pdf
scene from American Samoa Paradise Lost •How does power, both form.pdf
Footageetoffe16
 
QUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdf
QUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdfQUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdf
QUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdf
Footageetoffe16
 
Problems2. This is a map for a diploid plantR--------35-------.pdf
Problems2. This is a map for a diploid plantR--------35-------.pdfProblems2. This is a map for a diploid plantR--------35-------.pdf
Problems2. This is a map for a diploid plantR--------35-------.pdf
Footageetoffe16
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdf
Footageetoffe16
 
PLEASE PLEASE use you own words, do not copy and paste !!!This is .pdf
PLEASE PLEASE use you own words, do not copy and paste !!!This is .pdfPLEASE PLEASE use you own words, do not copy and paste !!!This is .pdf
PLEASE PLEASE use you own words, do not copy and paste !!!This is .pdf
Footageetoffe16
 
List the limitations of the GDP. Which one is most importantSol.pdf
List the limitations of the GDP. Which one is most importantSol.pdfList the limitations of the GDP. Which one is most importantSol.pdf
List the limitations of the GDP. Which one is most importantSol.pdf
Footageetoffe16
 
Information is given about a polynomial f(x) whose coefficients are r.pdf
Information is given about a polynomial f(x) whose coefficients are r.pdfInformation is given about a polynomial f(x) whose coefficients are r.pdf
Information is given about a polynomial f(x) whose coefficients are r.pdf
Footageetoffe16
 
I need to create two binary search trees in Ruby. One using recursio.pdf
I need to create two binary search trees in Ruby. One using recursio.pdfI need to create two binary search trees in Ruby. One using recursio.pdf
I need to create two binary search trees in Ruby. One using recursio.pdf
Footageetoffe16
 
I am studying gut flora and had a few questions.Can you discribe a.pdf
I am studying gut flora and had a few questions.Can you discribe a.pdfI am studying gut flora and had a few questions.Can you discribe a.pdf
I am studying gut flora and had a few questions.Can you discribe a.pdf
Footageetoffe16
 

More from Footageetoffe16 (20)

Why did the defendants fight jurisdiction in the United States in th.pdf
Why did the defendants fight jurisdiction in the United States in th.pdfWhy did the defendants fight jurisdiction in the United States in th.pdf
Why did the defendants fight jurisdiction in the United States in th.pdf
 
Why was the frontier important in American historySolutionFro.pdf
Why was the frontier important in American historySolutionFro.pdfWhy was the frontier important in American historySolutionFro.pdf
Why was the frontier important in American historySolutionFro.pdf
 
What is the multiplication principle Also, provide example.Solu.pdf
What is the multiplication principle Also, provide example.Solu.pdfWhat is the multiplication principle Also, provide example.Solu.pdf
What is the multiplication principle Also, provide example.Solu.pdf
 
What were the three primary goals of the FASB in developing the Codi.pdf
What were the three primary goals of the FASB in developing the Codi.pdfWhat were the three primary goals of the FASB in developing the Codi.pdf
What were the three primary goals of the FASB in developing the Codi.pdf
 
What is the difference between public relations and public affairs.pdf
What is the difference between public relations and public affairs.pdfWhat is the difference between public relations and public affairs.pdf
What is the difference between public relations and public affairs.pdf
 
What is Network Chatter and how does it affect performanceSolut.pdf
What is Network Chatter and how does it affect performanceSolut.pdfWhat is Network Chatter and how does it affect performanceSolut.pdf
What is Network Chatter and how does it affect performanceSolut.pdf
 
What are the elements types to add video and audio and give some att.pdf
What are the elements types to add video and audio and give some att.pdfWhat are the elements types to add video and audio and give some att.pdf
What are the elements types to add video and audio and give some att.pdf
 
What are the types of nonverbal communication used by President John.pdf
What are the types of nonverbal communication used by President John.pdfWhat are the types of nonverbal communication used by President John.pdf
What are the types of nonverbal communication used by President John.pdf
 
The owner of a small business is planning on expanding his business. .pdf
The owner of a small business is planning on expanding his business. .pdfThe owner of a small business is planning on expanding his business. .pdf
The owner of a small business is planning on expanding his business. .pdf
 
The government safety net creates an adverse selection problem and m.pdf
The government safety net creates an adverse selection problem and m.pdfThe government safety net creates an adverse selection problem and m.pdf
The government safety net creates an adverse selection problem and m.pdf
 
Syntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdf
Syntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdfSyntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdf
Syntrophy often involvesA. hydrogenB.OxygenC. fermentation by.pdf
 
scene from American Samoa Paradise Lost •How does power, both form.pdf
scene from American Samoa Paradise Lost •How does power, both form.pdfscene from American Samoa Paradise Lost •How does power, both form.pdf
scene from American Samoa Paradise Lost •How does power, both form.pdf
 
QUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdf
QUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdfQUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdf
QUESTION 25 Chris Korda, an advocate of a certain religion, publishes.pdf
 
Problems2. This is a map for a diploid plantR--------35-------.pdf
Problems2. This is a map for a diploid plantR--------35-------.pdfProblems2. This is a map for a diploid plantR--------35-------.pdf
Problems2. This is a map for a diploid plantR--------35-------.pdf
 
Prompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdfPrompt a user to enter a series of integers separated by spaces and .pdf
Prompt a user to enter a series of integers separated by spaces and .pdf
 
PLEASE PLEASE use you own words, do not copy and paste !!!This is .pdf
PLEASE PLEASE use you own words, do not copy and paste !!!This is .pdfPLEASE PLEASE use you own words, do not copy and paste !!!This is .pdf
PLEASE PLEASE use you own words, do not copy and paste !!!This is .pdf
 
List the limitations of the GDP. Which one is most importantSol.pdf
List the limitations of the GDP. Which one is most importantSol.pdfList the limitations of the GDP. Which one is most importantSol.pdf
List the limitations of the GDP. Which one is most importantSol.pdf
 
Information is given about a polynomial f(x) whose coefficients are r.pdf
Information is given about a polynomial f(x) whose coefficients are r.pdfInformation is given about a polynomial f(x) whose coefficients are r.pdf
Information is given about a polynomial f(x) whose coefficients are r.pdf
 
I need to create two binary search trees in Ruby. One using recursio.pdf
I need to create two binary search trees in Ruby. One using recursio.pdfI need to create two binary search trees in Ruby. One using recursio.pdf
I need to create two binary search trees in Ruby. One using recursio.pdf
 
I am studying gut flora and had a few questions.Can you discribe a.pdf
I am studying gut flora and had a few questions.Can you discribe a.pdfI am studying gut flora and had a few questions.Can you discribe a.pdf
I am studying gut flora and had a few questions.Can you discribe a.pdf
 

Recently uploaded

Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
sayalidalavi006
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 

Recently uploaded (20)

Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5Community pharmacy- Social and preventive pharmacy UNIT 5
Community pharmacy- Social and preventive pharmacy UNIT 5
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 

Design a Windows Desktop application and write the code that will exe.pdf

  • 1. Design a Windows Desktop application and write the code that will execute according to the program requirements in Figure 4-108. Before designing the user interface, create a Use Case Definition. Before writing the code, create an event-planning document for each event in the program. Solution import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.applet.*; public class IncomeTaxCalculator extends Applet implements ActionListener,WindowListener{ private Label label,label1,label2,label3; private JTextField txt,txt1,txt3,txt4; private JButton btn1,btn2; public void init(){ Frame f=new Frame(); Frame f1=new Frame(); f.setLayout(new BorderLayout()); f.setSize(1000, 300); Panel p=new Panel(); Panel pc1=new Panel(); f.add(pc1,"South"); f.add(p,"North"); label=new Label("Enter Income :"); label1=new Label("Tax To Be Paid :"); label2=new Label("Cess"); label3=new Label("Income Tax"); txt1=new JTextField(10); txt3=new JTextField(10); txt4=new JTextField(10); txt=new JTextField(10); p.add(label); p.add(txt); p.add(label3);
  • 2. p.add(txt4); p.add(label2); p.add(txt3); p.add(label1); p.add(txt1); btn1= new JButton("SUBMIT"); btn2= new JButton("EXIT"); pc1.add(btn1); pc1.add(btn2); f.setVisible(true); btn1.addActionListener(this); btn2.addActionListener(this); } public static void main(String args[]){ new IncomeTaxCalculator().init(); } @Override public void actionPerformed(ActionEvent e) { JButton btn=(JButton)e.getSource(); if(btn==btn1){ double a=Integer.parseInt(txt.getText()); double tax=0,b=0; if(a>0 && a<=160000){ txt1.setText("0"); txt4.setText("0"); txt3.setText("0"); }else if(a>160000 && a<=300000){ a=a-160000; tax=0.1*a; txt4.setText(String.valueOf(tax)); txt3.setText(String.valueOf(tax*.03)); tax+=tax*.03; txt1.setText(String.valueOf(tax));
  • 3. }else if(a>300000 && a<=500000){ a=a-300000; tax=0.2*a+14000; txt4.setText(String.valueOf(tax)); txt3.setText(String.valueOf(tax*.03)); tax+=tax*.03; txt1.setText(String.valueOf(tax)); }else if(a>500000){ a=a-500000; tax=0.3*a+54000; txt4.setText(String.valueOf(tax)); txt3.setText(String.valueOf(tax*.03)); tax+=tax*.03; txt1.setText(String.valueOf(tax)); } }else if(btn==btn2){ System.exit(0); } } @Override public void windowActivated(WindowEvent e) { } @Override public void windowClosed(WindowEvent e) { } @Override public void windowClosing(WindowEvent e) { } @Override public void windowDeactivated(WindowEvent e) { } @Override
  • 4. public void windowDeiconified(WindowEvent e) { } @Override public void windowIconified(WindowEvent e) { } @Override public void windowOpened(WindowEvent e) { } }