SlideShare a Scribd company logo
1 of 2
Download to read offline
Add the rest of the calculations to the code:The operations such as (+, -, *, /, MOD, Power, Squr,
^, Tan, Cos, Sin,)?
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.lang.Math;
import java.lang.Math.*;
import java.awt.Color;
import java.awt.color.*;
import java.awt.Font;
import java.awt.SystemColor;
class calc extends JFrame implements ActionListener {
JButton jb1;
JTextField jt1, jt2;
JLabel lbl,lb2,lb3,lb4;
private JButton button;
calc() {
getContentPane().setBackground(new Color(250, 191, 200));
//*******************JLabel**********************
lb3 = new JLabel("First number:");
lb3.setForeground(new Color(204, 51, 111));
lb3.setFont(new Font("Tahoma", Font.BOLD, 15));
lb3.setBounds(20, 50, 150, 30);
getContentPane().add(lb3);
//*******************JTextField**********************
jt1 = new JTextField();
jt1.setBounds(150, 53, 150, 30);
getContentPane().add(jt1);
//*******************JLabel**********************
lb4 = new JLabel("Second number:");
lb4.setForeground(new Color(102, 0, 255));
lb4.setFont(new Font("Tahoma", Font.BOLD, 15));
lb4.setBounds(20, 80, 150, 30);
getContentPane().add(lb4);
//*******************JTextField**********************
jt2 = new JTextField();
jt2.setBounds(150, 83, 150, 30);
getContentPane().add(jt2);
lb2 = new JLabel("-----");
lb2.setForeground(new Color(51, 51, 255));
lb2.setFont(new Font("Tahoma", Font.BOLD, 13));
lb2.setBounds(178, 140, 165, 30);
getContentPane().add(lb2);
//*******************JLabel**********************
lbl = new JLabel("The Result is:");
lbl.setForeground(new Color(51, 51, 255));
lbl.setFont(new Font("MS Mincho", Font.BOLD, 15));
lbl.setBounds(43, 138, 150, 30);
getContentPane().add(lbl);
// **************button*************************
jb1 = new JButton("+");
jb1.setBounds(30, 179, 100, 30);
jb1.setBackground(new Color(0, 191, 255));
getContentPane().add(jb1);
jb1.addActionListener(this);
getContentPane().setLayout(null);
setSize(400, 400);
setVisible(true);
};
public void actionPerformed(ActionEvent e) {
int a = Integer.parseInt(jt1.getText());
int b = Integer.parseInt(jt2.getText());
double c = 0;
if (e.getSource().equals(jb1)) {
c = a + b;
//lbl.setText(String.valueOf(c));
lb2.setText(String.valueOf(c));
}
}
public static void main(String args[]) {
calc t = new calc();
}
}

More Related Content

Similar to Add the rest of the calculations to the codeThe operations .pdf

Registro de venta
Registro de ventaRegistro de venta
Registro de ventalupe ga
 
9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx
9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx
9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docxransayo
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3martha leon
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 SpringKiyotaka Oku
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfflashfashioncasualwe
 
The sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfThe sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
 
The sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfThe sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdffathimaoptical
 
PQTimer.java A simple driver program to run timing t.docx
  PQTimer.java     A simple driver program to run timing t.docx  PQTimer.java     A simple driver program to run timing t.docx
PQTimer.java A simple driver program to run timing t.docxjoyjonna282
 
Microsoft word java
Microsoft word   javaMicrosoft word   java
Microsoft word javaRavi Purohit
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Kuldeep Jain
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressionsLogan Chien
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeletonIram Ramrajkar
 

Similar to Add the rest of the calculations to the codeThe operations .pdf (20)

Awt
AwtAwt
Awt
 
Registro de venta
Registro de ventaRegistro de venta
Registro de venta
 
9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx
9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx
9 11 25 14 44 6 41 15 57 9 39 16 41 2 58 8 43 12 4.docx
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3
 
CS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUALCS2309 JAVA LAB MANUAL
CS2309 JAVA LAB MANUAL
 
JJUG CCC 2011 Spring
JJUG CCC 2011 SpringJJUG CCC 2011 Spring
JJUG CCC 2011 Spring
 
Swing basics
Swing basicsSwing basics
Swing basics
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
 
The sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfThe sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdf
 
The sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfThe sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdf
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
 
PQTimer.java A simple driver program to run timing t.docx
  PQTimer.java     A simple driver program to run timing t.docx  PQTimer.java     A simple driver program to run timing t.docx
PQTimer.java A simple driver program to run timing t.docx
 
Microsoft word java
Microsoft word   javaMicrosoft word   java
Microsoft word java
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
 
Prog iv
Prog ivProg iv
Prog iv
 
culadora cientifica en java
culadora cientifica en javaculadora cientifica en java
culadora cientifica en java
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
 
Programs of java
Programs of javaPrograms of java
Programs of java
 
Java 8 lambda expressions
Java 8 lambda expressionsJava 8 lambda expressions
Java 8 lambda expressions
 
Advance Java Programs skeleton
Advance Java Programs skeletonAdvance Java Programs skeleton
Advance Java Programs skeleton
 

More from adityablinds

According to Bohnet 2016 if companies are going to use in.pdf
According to Bohnet 2016 if companies are going to use in.pdfAccording to Bohnet 2016 if companies are going to use in.pdf
According to Bohnet 2016 if companies are going to use in.pdfadityablinds
 
According to McNaughton and Rawling deontological theories .pdf
According to McNaughton and Rawling deontological theories .pdfAccording to McNaughton and Rawling deontological theories .pdf
According to McNaughton and Rawling deontological theories .pdfadityablinds
 
According to Canada Health Infoway September 20211 at the.pdf
According to Canada Health Infoway September 20211 at the.pdfAccording to Canada Health Infoway September 20211 at the.pdf
According to Canada Health Infoway September 20211 at the.pdfadityablinds
 
According to the Markowitz portfolio theory which of the fo.pdf
According to the Markowitz portfolio theory which of the fo.pdfAccording to the Markowitz portfolio theory which of the fo.pdf
According to the Markowitz portfolio theory which of the fo.pdfadityablinds
 
after receiving a change of shift report for clients on a me.pdf
after receiving a change of shift report for clients on a me.pdfafter receiving a change of shift report for clients on a me.pdf
after receiving a change of shift report for clients on a me.pdfadityablinds
 
After reading chapter 4 in the textbook the DJ article .pdf
After reading chapter 4 in the textbook the DJ article .pdfAfter reading chapter 4 in the textbook the DJ article .pdf
After reading chapter 4 in the textbook the DJ article .pdfadityablinds
 
After reading the three assigned articles in a 500750word.pdf
After reading the three assigned articles in a 500750word.pdfAfter reading the three assigned articles in a 500750word.pdf
After reading the three assigned articles in a 500750word.pdfadityablinds
 
After it experiences a helium flash a star like the Sun w.pdf
After it experiences a helium flash a star like the Sun w.pdfAfter it experiences a helium flash a star like the Sun w.pdf
After it experiences a helium flash a star like the Sun w.pdfadityablinds
 
According to separate analyses by the Organization for Econo.pdf
According to separate analyses by the Organization for Econo.pdfAccording to separate analyses by the Organization for Econo.pdf
According to separate analyses by the Organization for Econo.pdfadityablinds
 
After evaluating Michikas performance and leadership potent.pdf
After evaluating Michikas performance and leadership potent.pdfAfter evaluating Michikas performance and leadership potent.pdf
After evaluating Michikas performance and leadership potent.pdfadityablinds
 
After an exciting day runningyou sit down and eat a sandwich.pdf
After an exciting day runningyou sit down and eat a sandwich.pdfAfter an exciting day runningyou sit down and eat a sandwich.pdf
After an exciting day runningyou sit down and eat a sandwich.pdfadityablinds
 
After a mayor announced his plans to cut budget costs in lat.pdf
After a mayor announced his plans to cut budget costs in lat.pdfAfter a mayor announced his plans to cut budget costs in lat.pdf
After a mayor announced his plans to cut budget costs in lat.pdfadityablinds
 
Aeromonas hydrophilia Where is it found in the environment.pdf
Aeromonas hydrophilia Where is it found in the environment.pdfAeromonas hydrophilia Where is it found in the environment.pdf
Aeromonas hydrophilia Where is it found in the environment.pdfadityablinds
 
Advanced practice providers NPs and PAs are expected to .pdf
Advanced practice providers NPs and PAs are expected to .pdfAdvanced practice providers NPs and PAs are expected to .pdf
Advanced practice providers NPs and PAs are expected to .pdfadityablinds
 
Adolph Berle ve Gardiner Means geni apta sahip olunan irke.pdf
Adolph Berle ve Gardiner Means geni apta sahip olunan irke.pdfAdolph Berle ve Gardiner Means geni apta sahip olunan irke.pdf
Adolph Berle ve Gardiner Means geni apta sahip olunan irke.pdfadityablinds
 
Advantages of webbased surveys include all but Maintai.pdf
Advantages of webbased surveys include all but     Maintai.pdfAdvantages of webbased surveys include all but     Maintai.pdf
Advantages of webbased surveys include all but Maintai.pdfadityablinds
 
Adjust the method loadApproved in class VaxProgram so that i.pdf
Adjust the method loadApproved in class VaxProgram so that i.pdfAdjust the method loadApproved in class VaxProgram so that i.pdf
Adjust the method loadApproved in class VaxProgram so that i.pdfadityablinds
 
Administracin de Empresas No es el tpico CEO De hecho a.pdf
Administracin de Empresas  No es el tpico CEO De hecho a.pdfAdministracin de Empresas  No es el tpico CEO De hecho a.pdf
Administracin de Empresas No es el tpico CEO De hecho a.pdfadityablinds
 
According to Hudson and Booth Information Management IM i.pdf
According to Hudson and Booth Information Management IM i.pdfAccording to Hudson and Booth Information Management IM i.pdf
According to Hudson and Booth Information Management IM i.pdfadityablinds
 
Adenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdf
Adenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdfAdenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdf
Adenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdfadityablinds
 

More from adityablinds (20)

According to Bohnet 2016 if companies are going to use in.pdf
According to Bohnet 2016 if companies are going to use in.pdfAccording to Bohnet 2016 if companies are going to use in.pdf
According to Bohnet 2016 if companies are going to use in.pdf
 
According to McNaughton and Rawling deontological theories .pdf
According to McNaughton and Rawling deontological theories .pdfAccording to McNaughton and Rawling deontological theories .pdf
According to McNaughton and Rawling deontological theories .pdf
 
According to Canada Health Infoway September 20211 at the.pdf
According to Canada Health Infoway September 20211 at the.pdfAccording to Canada Health Infoway September 20211 at the.pdf
According to Canada Health Infoway September 20211 at the.pdf
 
According to the Markowitz portfolio theory which of the fo.pdf
According to the Markowitz portfolio theory which of the fo.pdfAccording to the Markowitz portfolio theory which of the fo.pdf
According to the Markowitz portfolio theory which of the fo.pdf
 
after receiving a change of shift report for clients on a me.pdf
after receiving a change of shift report for clients on a me.pdfafter receiving a change of shift report for clients on a me.pdf
after receiving a change of shift report for clients on a me.pdf
 
After reading chapter 4 in the textbook the DJ article .pdf
After reading chapter 4 in the textbook the DJ article .pdfAfter reading chapter 4 in the textbook the DJ article .pdf
After reading chapter 4 in the textbook the DJ article .pdf
 
After reading the three assigned articles in a 500750word.pdf
After reading the three assigned articles in a 500750word.pdfAfter reading the three assigned articles in a 500750word.pdf
After reading the three assigned articles in a 500750word.pdf
 
After it experiences a helium flash a star like the Sun w.pdf
After it experiences a helium flash a star like the Sun w.pdfAfter it experiences a helium flash a star like the Sun w.pdf
After it experiences a helium flash a star like the Sun w.pdf
 
According to separate analyses by the Organization for Econo.pdf
According to separate analyses by the Organization for Econo.pdfAccording to separate analyses by the Organization for Econo.pdf
According to separate analyses by the Organization for Econo.pdf
 
After evaluating Michikas performance and leadership potent.pdf
After evaluating Michikas performance and leadership potent.pdfAfter evaluating Michikas performance and leadership potent.pdf
After evaluating Michikas performance and leadership potent.pdf
 
After an exciting day runningyou sit down and eat a sandwich.pdf
After an exciting day runningyou sit down and eat a sandwich.pdfAfter an exciting day runningyou sit down and eat a sandwich.pdf
After an exciting day runningyou sit down and eat a sandwich.pdf
 
After a mayor announced his plans to cut budget costs in lat.pdf
After a mayor announced his plans to cut budget costs in lat.pdfAfter a mayor announced his plans to cut budget costs in lat.pdf
After a mayor announced his plans to cut budget costs in lat.pdf
 
Aeromonas hydrophilia Where is it found in the environment.pdf
Aeromonas hydrophilia Where is it found in the environment.pdfAeromonas hydrophilia Where is it found in the environment.pdf
Aeromonas hydrophilia Where is it found in the environment.pdf
 
Advanced practice providers NPs and PAs are expected to .pdf
Advanced practice providers NPs and PAs are expected to .pdfAdvanced practice providers NPs and PAs are expected to .pdf
Advanced practice providers NPs and PAs are expected to .pdf
 
Adolph Berle ve Gardiner Means geni apta sahip olunan irke.pdf
Adolph Berle ve Gardiner Means geni apta sahip olunan irke.pdfAdolph Berle ve Gardiner Means geni apta sahip olunan irke.pdf
Adolph Berle ve Gardiner Means geni apta sahip olunan irke.pdf
 
Advantages of webbased surveys include all but Maintai.pdf
Advantages of webbased surveys include all but     Maintai.pdfAdvantages of webbased surveys include all but     Maintai.pdf
Advantages of webbased surveys include all but Maintai.pdf
 
Adjust the method loadApproved in class VaxProgram so that i.pdf
Adjust the method loadApproved in class VaxProgram so that i.pdfAdjust the method loadApproved in class VaxProgram so that i.pdf
Adjust the method loadApproved in class VaxProgram so that i.pdf
 
Administracin de Empresas No es el tpico CEO De hecho a.pdf
Administracin de Empresas  No es el tpico CEO De hecho a.pdfAdministracin de Empresas  No es el tpico CEO De hecho a.pdf
Administracin de Empresas No es el tpico CEO De hecho a.pdf
 
According to Hudson and Booth Information Management IM i.pdf
According to Hudson and Booth Information Management IM i.pdfAccording to Hudson and Booth Information Management IM i.pdf
According to Hudson and Booth Information Management IM i.pdf
 
Adenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdf
Adenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdfAdenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdf
Adenilil siklaz inaktif olacak ekilde bir hcre mutasyona ur.pdf
 

Recently uploaded

The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Add the rest of the calculations to the codeThe operations .pdf

  • 1. Add the rest of the calculations to the code:The operations such as (+, -, *, /, MOD, Power, Squr, ^, Tan, Cos, Sin,)? import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; import java.lang.Math; import java.lang.Math.*; import java.awt.Color; import java.awt.color.*; import java.awt.Font; import java.awt.SystemColor; class calc extends JFrame implements ActionListener { JButton jb1; JTextField jt1, jt2; JLabel lbl,lb2,lb3,lb4; private JButton button; calc() { getContentPane().setBackground(new Color(250, 191, 200)); //*******************JLabel********************** lb3 = new JLabel("First number:"); lb3.setForeground(new Color(204, 51, 111)); lb3.setFont(new Font("Tahoma", Font.BOLD, 15)); lb3.setBounds(20, 50, 150, 30); getContentPane().add(lb3); //*******************JTextField********************** jt1 = new JTextField(); jt1.setBounds(150, 53, 150, 30); getContentPane().add(jt1); //*******************JLabel********************** lb4 = new JLabel("Second number:"); lb4.setForeground(new Color(102, 0, 255)); lb4.setFont(new Font("Tahoma", Font.BOLD, 15)); lb4.setBounds(20, 80, 150, 30); getContentPane().add(lb4); //*******************JTextField********************** jt2 = new JTextField(); jt2.setBounds(150, 83, 150, 30); getContentPane().add(jt2); lb2 = new JLabel("-----"); lb2.setForeground(new Color(51, 51, 255));
  • 2. lb2.setFont(new Font("Tahoma", Font.BOLD, 13)); lb2.setBounds(178, 140, 165, 30); getContentPane().add(lb2); //*******************JLabel********************** lbl = new JLabel("The Result is:"); lbl.setForeground(new Color(51, 51, 255)); lbl.setFont(new Font("MS Mincho", Font.BOLD, 15)); lbl.setBounds(43, 138, 150, 30); getContentPane().add(lbl); // **************button************************* jb1 = new JButton("+"); jb1.setBounds(30, 179, 100, 30); jb1.setBackground(new Color(0, 191, 255)); getContentPane().add(jb1); jb1.addActionListener(this); getContentPane().setLayout(null); setSize(400, 400); setVisible(true); }; public void actionPerformed(ActionEvent e) { int a = Integer.parseInt(jt1.getText()); int b = Integer.parseInt(jt2.getText()); double c = 0; if (e.getSource().equals(jb1)) { c = a + b; //lbl.setText(String.valueOf(c)); lb2.setText(String.valueOf(c)); } } public static void main(String args[]) { calc t = new calc(); } }