SlideShare une entreprise Scribd logo
1  sur  1
Télécharger pour lire hors ligne
8-7. Modify exercise 7-2 on comparing strings so it is now done in a GUI application frame class
definition with a main instead of a console application. The GUI components will be data fields
of the class definition. The prompts will now be in labels and the input will now be textfields.
The user will hit enter in the second textfield to get the results in two other answer labels. The
results (which is greater and the difference amount) will be in these two other answer labels.
Declare everything at the top, use the constructor to add the components to your container (use
background and foreground colors and the flow layout), and use actionPerformed to do three
things: get the text out of the textfields for the two strings (instead of readLines), to perform the
nested if else with the comparisons, and the setting of the answers in the two answer labels -
which is greater and the difference (instead of printlns). Use a little main method to construct
yourself. Set the size so the components flow properly (make sure labels are next to textfields,
etc.) and there is not a lot of extra space. Take a picture of the output GUI frame with
<Alt><PrtScr> which will copy the frame, paste into paint, and save as a .jpg file. Attach the .
java program file .jpg output file and submit.
* Bil1 Wohlleber zxercise 7 2 This program will compare 2 strings / mport java. io. ublic class
ex72 public static void main(String[] args) throws IOException { String s1, s2; BufferedReader
br = new BufferedReader (new InputStreamReader (System. in)); System. out. print ("Enter a
string: "); s 1 = br. readLine () ; System. out. print("Enter a string: "); s 2 = br. readLine () ; if ( s
1 . equals ( s 2 )) // s 1 == s 2 System. out. println( "Same string"); else if (sl. equalsIgnoreCase
(s2)) System. out. println ("Same string - different case"); else if ( s 1 . compareTo ( s 2 ) > 0 ) //
s 1 > s 2 System. out. println ( s 1 + + is alphabetically greater than " + s 2 ) else // s 1 < s 2
System. out. println (s1 + " is alphabetically less than " + s 2 ) System. out. println ("Difference
is " + sl. compareTo (s2)); }

Contenu connexe

Similaire à 8-7- Modify exercise 7-2 on comparing strings so it is now done in a G.pdf

Map reduceoriginalpaper mandatoryreading
Map reduceoriginalpaper mandatoryreadingMap reduceoriginalpaper mandatoryreading
Map reduceoriginalpaper mandatoryreadingcoolmirza143
 
Map reduce
Map reduceMap reduce
Map reducexydii
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern ImplementationSteve Widom
 
nlp dl 1.pdf
nlp dl 1.pdfnlp dl 1.pdf
nlp dl 1.pdfnyomans1
 
SCons an Introduction
SCons an IntroductionSCons an Introduction
SCons an Introductionslantsixgames
 
Control system Lab record
Control system Lab record Control system Lab record
Control system Lab record Yuvraj Singh
 
Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Saajid Akram
 
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmProgramming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmMahmoud Samir Fayed
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEWshyamuopten
 
2004 map reduce simplied data processing on large clusters (mapreduce)
2004 map reduce simplied data processing on large clusters (mapreduce)2004 map reduce simplied data processing on large clusters (mapreduce)
2004 map reduce simplied data processing on large clusters (mapreduce)anh tuan
 
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docxOverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docxhoney690131
 
Java conceptual learning material
Java conceptual learning materialJava conceptual learning material
Java conceptual learning materialArthyR3
 
Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make YASHU40
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_netNico Ludwig
 
Scaling Application on High Performance Computing Clusters and Analysis of th...
Scaling Application on High Performance Computing Clusters and Analysis of th...Scaling Application on High Performance Computing Clusters and Analysis of th...
Scaling Application on High Performance Computing Clusters and Analysis of th...Rusif Eyvazli
 

Similaire à 8-7- Modify exercise 7-2 on comparing strings so it is now done in a G.pdf (20)

Map reduceoriginalpaper mandatoryreading
Map reduceoriginalpaper mandatoryreadingMap reduceoriginalpaper mandatoryreading
Map reduceoriginalpaper mandatoryreading
 
Map reduce
Map reduceMap reduce
Map reduce
 
Memento Pattern Implementation
Memento Pattern ImplementationMemento Pattern Implementation
Memento Pattern Implementation
 
nlp dl 1.pdf
nlp dl 1.pdfnlp dl 1.pdf
nlp dl 1.pdf
 
SCons an Introduction
SCons an IntroductionSCons an Introduction
SCons an Introduction
 
Control system Lab record
Control system Lab record Control system Lab record
Control system Lab record
 
Class[3][5th jun] [three js]
Class[3][5th jun] [three js]Class[3][5th jun] [three js]
Class[3][5th jun] [three js]
 
Slides chapters 28-32
Slides chapters 28-32Slides chapters 28-32
Slides chapters 28-32
 
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming ParadigmProgramming Without Coding Technology (PWCT) Features - Programming Paradigm
Programming Without Coding Technology (PWCT) Features - Programming Paradigm
 
Qe Reference
Qe ReferenceQe Reference
Qe Reference
 
GSP 125 Entire Course NEW
GSP 125 Entire Course NEWGSP 125 Entire Course NEW
GSP 125 Entire Course NEW
 
Map reduce
Map reduceMap reduce
Map reduce
 
2004 map reduce simplied data processing on large clusters (mapreduce)
2004 map reduce simplied data processing on large clusters (mapreduce)2004 map reduce simplied data processing on large clusters (mapreduce)
2004 map reduce simplied data processing on large clusters (mapreduce)
 
Operating System Assignment Help
Operating System Assignment HelpOperating System Assignment Help
Operating System Assignment Help
 
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docxOverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docx
 
Java conceptual learning material
Java conceptual learning materialJava conceptual learning material
Java conceptual learning material
 
Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make Question 1 briefly respond to all the following questions. make
Question 1 briefly respond to all the following questions. make
 
(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net(1) c sharp introduction_basics_dot_net
(1) c sharp introduction_basics_dot_net
 
CBSE Sample Paper IP
CBSE Sample Paper IPCBSE Sample Paper IP
CBSE Sample Paper IP
 
Scaling Application on High Performance Computing Clusters and Analysis of th...
Scaling Application on High Performance Computing Clusters and Analysis of th...Scaling Application on High Performance Computing Clusters and Analysis of th...
Scaling Application on High Performance Computing Clusters and Analysis of th...
 

Plus de JohnKyQMorrisont

A capital gain results when you sell an asset for less than you paid f.pdf
A capital gain results when you sell an asset for less than you paid f.pdfA capital gain results when you sell an asset for less than you paid f.pdf
A capital gain results when you sell an asset for less than you paid f.pdfJohnKyQMorrisont
 
A bacteria living in Antarctica would have what types of hydrocarbon t.pdf
A bacteria living in Antarctica would have what types of hydrocarbon t.pdfA bacteria living in Antarctica would have what types of hydrocarbon t.pdf
A bacteria living in Antarctica would have what types of hydrocarbon t.pdfJohnKyQMorrisont
 
A 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdf
A 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdfA 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdf
A 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdfJohnKyQMorrisont
 
A 17-year-old Senior High School student visited the clinic for consul.pdf
A 17-year-old Senior High School student visited the clinic for consul.pdfA 17-year-old Senior High School student visited the clinic for consul.pdf
A 17-year-old Senior High School student visited the clinic for consul.pdfJohnKyQMorrisont
 
9- What was your unknown- Which test(s) helped you determine its ident.pdf
9- What was your unknown- Which test(s) helped you determine its ident.pdf9- What was your unknown- Which test(s) helped you determine its ident.pdf
9- What was your unknown- Which test(s) helped you determine its ident.pdfJohnKyQMorrisont
 
9- Describe the process of performing a general survey 10- Demonstrate.pdf
9- Describe the process of performing a general survey 10- Demonstrate.pdf9- Describe the process of performing a general survey 10- Demonstrate.pdf
9- Describe the process of performing a general survey 10- Demonstrate.pdfJohnKyQMorrisont
 
8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf
8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf
8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdfJohnKyQMorrisont
 
8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf
8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf
8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdfJohnKyQMorrisont
 
8- The languase is recongnized by the Followins N NA( is anther notati.pdf
8- The languase is recongnized by the Followins N NA( is anther notati.pdf8- The languase is recongnized by the Followins N NA( is anther notati.pdf
8- The languase is recongnized by the Followins N NA( is anther notati.pdfJohnKyQMorrisont
 
8- The larpest assat eategory of iile inturers in and the largest Haba.pdf
8- The larpest assat eategory of iile inturers in and the largest Haba.pdf8- The larpest assat eategory of iile inturers in and the largest Haba.pdf
8- The larpest assat eategory of iile inturers in and the largest Haba.pdfJohnKyQMorrisont
 
8- The following protocols set up a virtual circuit for supporting TCP.pdf
8- The following protocols set up a virtual circuit for supporting TCP.pdf8- The following protocols set up a virtual circuit for supporting TCP.pdf
8- The following protocols set up a virtual circuit for supporting TCP.pdfJohnKyQMorrisont
 
8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf
8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf
8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdfJohnKyQMorrisont
 
8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf
8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf
8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdfJohnKyQMorrisont
 
8- Name and explain one element of powerful listening skills- 9- Discu.pdf
8- Name and explain one element of powerful listening skills- 9- Discu.pdf8- Name and explain one element of powerful listening skills- 9- Discu.pdf
8- Name and explain one element of powerful listening skills- 9- Discu.pdfJohnKyQMorrisont
 
79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdfJohnKyQMorrisont
 
71- Economic growth typically results in longer life expectancies- F.pdf
71- Economic growth typically results in longer life expectancies-   F.pdf71- Economic growth typically results in longer life expectancies-   F.pdf
71- Economic growth typically results in longer life expectancies- F.pdfJohnKyQMorrisont
 
79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdfJohnKyQMorrisont
 
7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf
7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf
7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdfJohnKyQMorrisont
 
7-1 In order to implement the classic DoS flood attack- the attacker m.pdf
7-1 In order to implement the classic DoS flood attack- the attacker m.pdf7-1 In order to implement the classic DoS flood attack- the attacker m.pdf
7-1 In order to implement the classic DoS flood attack- the attacker m.pdfJohnKyQMorrisont
 
7- What is the main disadvantages of k-means clustering method-2- Show.pdf
7- What is the main disadvantages of k-means clustering method-2- Show.pdf7- What is the main disadvantages of k-means clustering method-2- Show.pdf
7- What is the main disadvantages of k-means clustering method-2- Show.pdfJohnKyQMorrisont
 

Plus de JohnKyQMorrisont (20)

A capital gain results when you sell an asset for less than you paid f.pdf
A capital gain results when you sell an asset for less than you paid f.pdfA capital gain results when you sell an asset for less than you paid f.pdf
A capital gain results when you sell an asset for less than you paid f.pdf
 
A bacteria living in Antarctica would have what types of hydrocarbon t.pdf
A bacteria living in Antarctica would have what types of hydrocarbon t.pdfA bacteria living in Antarctica would have what types of hydrocarbon t.pdf
A bacteria living in Antarctica would have what types of hydrocarbon t.pdf
 
A 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdf
A 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdfA 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdf
A 2019 article in the New York Times was headlined- -Trump Thinks Doll.pdf
 
A 17-year-old Senior High School student visited the clinic for consul.pdf
A 17-year-old Senior High School student visited the clinic for consul.pdfA 17-year-old Senior High School student visited the clinic for consul.pdf
A 17-year-old Senior High School student visited the clinic for consul.pdf
 
9- What was your unknown- Which test(s) helped you determine its ident.pdf
9- What was your unknown- Which test(s) helped you determine its ident.pdf9- What was your unknown- Which test(s) helped you determine its ident.pdf
9- What was your unknown- Which test(s) helped you determine its ident.pdf
 
9- Describe the process of performing a general survey 10- Demonstrate.pdf
9- Describe the process of performing a general survey 10- Demonstrate.pdf9- Describe the process of performing a general survey 10- Demonstrate.pdf
9- Describe the process of performing a general survey 10- Demonstrate.pdf
 
8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf
8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf
8-00- 3) Condenisel financial dats of Kitches Giadyets Ceempany appear.pdf
 
8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf
8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf
8- Waterworld- 1995- A- What created the monster (and or evil situatio.pdf
 
8- The languase is recongnized by the Followins N NA( is anther notati.pdf
8- The languase is recongnized by the Followins N NA( is anther notati.pdf8- The languase is recongnized by the Followins N NA( is anther notati.pdf
8- The languase is recongnized by the Followins N NA( is anther notati.pdf
 
8- The larpest assat eategory of iile inturers in and the largest Haba.pdf
8- The larpest assat eategory of iile inturers in and the largest Haba.pdf8- The larpest assat eategory of iile inturers in and the largest Haba.pdf
8- The larpest assat eategory of iile inturers in and the largest Haba.pdf
 
8- The following protocols set up a virtual circuit for supporting TCP.pdf
8- The following protocols set up a virtual circuit for supporting TCP.pdf8- The following protocols set up a virtual circuit for supporting TCP.pdf
8- The following protocols set up a virtual circuit for supporting TCP.pdf
 
8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf
8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf
8- The Terrorism Risk and Insurance Act (TRIA) was enacted shortly aft.pdf
 
8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf
8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf
8- Recognize the characteristics of inflammation- 9- Cite and interpre.pdf
 
8- Name and explain one element of powerful listening skills- 9- Discu.pdf
8- Name and explain one element of powerful listening skills- 9- Discu.pdf8- Name and explain one element of powerful listening skills- 9- Discu.pdf
8- Name and explain one element of powerful listening skills- 9- Discu.pdf
 
79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep (1).pdf
 
71- Economic growth typically results in longer life expectancies- F.pdf
71- Economic growth typically results in longer life expectancies-   F.pdf71- Economic growth typically results in longer life expectancies-   F.pdf
71- Economic growth typically results in longer life expectancies- F.pdf
 
79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf
79 Pest Control Methods pertade at werpont- and so does not iffect sep.pdf
 
7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf
7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf
7-29 Bird songs- Bird songs have been hypothesized to be a secondary s.pdf
 
7-1 In order to implement the classic DoS flood attack- the attacker m.pdf
7-1 In order to implement the classic DoS flood attack- the attacker m.pdf7-1 In order to implement the classic DoS flood attack- the attacker m.pdf
7-1 In order to implement the classic DoS flood attack- the attacker m.pdf
 
7- What is the main disadvantages of k-means clustering method-2- Show.pdf
7- What is the main disadvantages of k-means clustering method-2- Show.pdf7- What is the main disadvantages of k-means clustering method-2- Show.pdf
7- What is the main disadvantages of k-means clustering method-2- Show.pdf
 

Dernier

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxAneriPatwari
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 

Dernier (20)

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
CHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptxCHEST Proprioceptive neuromuscular facilitation.pptx
CHEST Proprioceptive neuromuscular facilitation.pptx
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 

8-7- Modify exercise 7-2 on comparing strings so it is now done in a G.pdf

  • 1. 8-7. Modify exercise 7-2 on comparing strings so it is now done in a GUI application frame class definition with a main instead of a console application. The GUI components will be data fields of the class definition. The prompts will now be in labels and the input will now be textfields. The user will hit enter in the second textfield to get the results in two other answer labels. The results (which is greater and the difference amount) will be in these two other answer labels. Declare everything at the top, use the constructor to add the components to your container (use background and foreground colors and the flow layout), and use actionPerformed to do three things: get the text out of the textfields for the two strings (instead of readLines), to perform the nested if else with the comparisons, and the setting of the answers in the two answer labels - which is greater and the difference (instead of printlns). Use a little main method to construct yourself. Set the size so the components flow properly (make sure labels are next to textfields, etc.) and there is not a lot of extra space. Take a picture of the output GUI frame with <Alt><PrtScr> which will copy the frame, paste into paint, and save as a .jpg file. Attach the . java program file .jpg output file and submit. * Bil1 Wohlleber zxercise 7 2 This program will compare 2 strings / mport java. io. ublic class ex72 public static void main(String[] args) throws IOException { String s1, s2; BufferedReader br = new BufferedReader (new InputStreamReader (System. in)); System. out. print ("Enter a string: "); s 1 = br. readLine () ; System. out. print("Enter a string: "); s 2 = br. readLine () ; if ( s 1 . equals ( s 2 )) // s 1 == s 2 System. out. println( "Same string"); else if (sl. equalsIgnoreCase (s2)) System. out. println ("Same string - different case"); else if ( s 1 . compareTo ( s 2 ) > 0 ) // s 1 > s 2 System. out. println ( s 1 + + is alphabetically greater than " + s 2 ) else // s 1 < s 2 System. out. println (s1 + " is alphabetically less than " + s 2 ) System. out. println ("Difference is " + sl. compareTo (s2)); }