Please help with Ceaser Cipher in JavaFX!! Here is my code: package testweek8; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionListener; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; import java.io.*; import java.util.List;
Please help with Ceaser Cipher in JavaFX!!
Here is my code:
package testweek8;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionListener;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.io.*;
import java.util.List;
public class TestWeek8 {
private static int constant;
private static String alphabet;
public static void main (String[]args) {
displayMenu();
getPhrase();
}
private Static ActionListener;
myActionListener;
public void loadData(){
char[] alphabet;
for (char c = 'a';c <= 'z'; ++c) {
alphabet [c - 'a'] = c;
}
}
public static void displayMenu(){
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.setBackground(Color.darkGray);
panel.setLayout(new BoxLayout.LINE _Axis);
JButton button1 = new JButton("Decode a message");
button1.addActionListner(myActionListner);
JButton button2 = new JButton("Encode a message");
button2.addActionListner(myActionListner);
JButton button3 = new JButton("Display a message");
button1.addActionListner(myActionListner);
JButton button4 = new JButton("Exit the program");
button1.addActionListner(myActionListner);
panel1.add(button1);
panel1.add(button2);
panel1.add(button3);
panel1.add(button4);
frame.getContentPane().add(BorderLayout.Center.panel);
frame.setSize(575,300);
frame.setVisible(true);
}
public static void getPhrase(){
JTextField(" ");
System.out.printlnfield.getText());
}
public String encodeMessage(String field) {
int coded;
int temp;
StringBuffer s = new StringBuffer();
String Field;
field = field.toLowerCase();
for(int index = 0; index<field.length();index++){
temp = findNum(field.charAt(index));
if(temp! = -1) {
coded multi = findNum(field.charAt(index))+constant;
if(coded>25) {
temp = coded/26;
coded = coded-(temp*26);}
What I'm trying to do is this: The GUI that you will develop is the “front-end” of the project. The “back-end” is the translate() method that you will (re-)use. I also should mention that this all needs to be done in Netbeans.
I keep getting this message when I run it:
![Browse JavaFX Application Classes
Available dasses:
Select Class
Cancel](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Ff46b9ae5-e306-4cf1-a110-42e2827236a8%2F099adddd-ca2f-4d11-b514-c02bb1d4a6c0%2F5wtbop5_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)