Please help me fix this program. It is constantly saying I have duplicates of class main and many more Main. Java is below as well as my gui which is the photos (the gui is my problem) import java.util.*; public class Main { //Inputs a one character string and returns True if the character is a letter (i.e. a to z or A to Z). Returns false if it is not. A function to check that the password or encryption key is valid. public static boolean isALetter(char letter){ if( (letter >= 'a' && letter = 'A' && letter =-32767 && encryptKey

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Please help me fix this program. It is constantly saying I have duplicates of class main and many more Main. Java is below as well as my gui which is the photos (the gui is my problem) import java.util.*; public class Main { //Inputs a one character string and returns True if the character is a letter (i.e. a to z or A to Z). Returns false if it is not. A function to check that the password or encryption key is valid. public static boolean isALetter(char letter){ if( (letter >= 'a' && letter = 'A' && letter =-32767 && encryptKey
46
// check which button was clicked
47 if (e.getSource () == btnDe)
48▼ {
49 // declare strings for input and output
50 StringBuilder s = new StringBuilder();
51
52 s.append(phrase In);
53
54 s.reverse();
55 phraseIn = txt In.getText (); // get the input string
56 phraseOut = phraseIn.reverse();
57 txtOut.setText (phraseOut);
58
}
59
else if (e.getSource () == btnClear)
60
{
61
txtIn.setText (""); // clear both strings
txtOut.setText ("");
62
63
64
}
65
}
66
public static void main(String[] args)
67▼
{
68
new Main();
69
70 }
71
}
Transcribed Image Text:46 // check which button was clicked 47 if (e.getSource () == btnDe) 48▼ { 49 // declare strings for input and output 50 StringBuilder s = new StringBuilder(); 51 52 s.append(phrase In); 53 54 s.reverse(); 55 phraseIn = txt In.getText (); // get the input string 56 phraseOut = phraseIn.reverse(); 57 txtOut.setText (phraseOut); 58 } 59 else if (e.getSource () == btnClear) 60 { 61 txtIn.setText (""); // clear both strings txtOut.setText (""); 62 63 64 } 65 } 66 public static void main(String[] args) 67▼ { 68 new Main(); 69 70 } 71 }
1 import java.awt. *;
2 import javax.swing. *;
3 import java.awt.event. *;
4 import java.io.*;
5 import java.util.*;
6
7▼ class Main extends JFrame implements ActionListener {
8
9
JButton btnClear, btnEn, btnDe;
JTextField txtIn, txtOut;
10
11
JLabel lblEn, lblDe;
12
13 ▼
public Main () {
14
15
super("Super Spy Encryption");
16
17
18
btnClear = new JButton("Clear");
btnEn = new JButton("Encrypt");
btnDe = new JButton("Decrypt");
19
20
21
22
btnClear. addActionListener(this);
btnEn. addActionListener(this);
btnDe. addActionListener(this);
23
24
25
txtIn= new JTextField(50);
26
txtout= new JTextField(50);
27
28
lblEn= new JLabel("Type your message to Encrypt here");
lblDe= new JLabel("Type your message to Decrypt here");
29
30
31
set Layout(new Grid Layout (7,1));
32
add (lblen);
33
add (txtIn);
34
add (lblDe);
35
add (txtOut);
36
add (btnEn);
37
add (btnDe);
38
add (btnClear);
39
40
setSize(300,300);
41
setVisible(true);
42
43
} // Constructor
44 public void action Performed (ActionEvent e)
45 ▼ {
Transcribed Image Text:1 import java.awt. *; 2 import javax.swing. *; 3 import java.awt.event. *; 4 import java.io.*; 5 import java.util.*; 6 7▼ class Main extends JFrame implements ActionListener { 8 9 JButton btnClear, btnEn, btnDe; JTextField txtIn, txtOut; 10 11 JLabel lblEn, lblDe; 12 13 ▼ public Main () { 14 15 super("Super Spy Encryption"); 16 17 18 btnClear = new JButton("Clear"); btnEn = new JButton("Encrypt"); btnDe = new JButton("Decrypt"); 19 20 21 22 btnClear. addActionListener(this); btnEn. addActionListener(this); btnDe. addActionListener(this); 23 24 25 txtIn= new JTextField(50); 26 txtout= new JTextField(50); 27 28 lblEn= new JLabel("Type your message to Encrypt here"); lblDe= new JLabel("Type your message to Decrypt here"); 29 30 31 set Layout(new Grid Layout (7,1)); 32 add (lblen); 33 add (txtIn); 34 add (lblDe); 35 add (txtOut); 36 add (btnEn); 37 add (btnDe); 38 add (btnClear); 39 40 setSize(300,300); 41 setVisible(true); 42 43 } // Constructor 44 public void action Performed (ActionEvent e) 45 ▼ {
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education