Question
There are two errors in this program that I can't figure out how to fix. Can someone help?? LatinTranslator.java import javafx.application.Application; import static javafx.application.Application.launch; import
There are two errors in this program that I can't figure out how to fix. Can someone help??
LatinTranslator.java
import javafx.application.Application; import static javafx.application.Application.launch; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage;
/** This is the main application class for the Latin Translator programming challenge. */ public class LatinTranslator extends Application { public void start(Stage stage) throws Exception { // Load the FXML file. Parent parent = FXMLLoader.load(getClass().getResource()); // Build the scene graph. Scene scene = new Scene(parent); // Display our window, using the scene graph. stage.setTitle("Latin Translator"); stage.setScene(scene); stage.show(); } public static void main(String[] args) { // Launch the application. launch(args); } }
---------------------------------------------------------------------------------
This one is fine, it just goes with the first program.
LatinTranslatorController.java
import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.Label;
/** This is the controller class for the Latin Translator programming challenge. */ public class LatinTranslatorController { @FXML private Button sinisterButton;
@FXML private Button dexterButton;
@FXML private Button mediumButton;
@FXML private Label outputLabel;
// Event listener for the sinisterButton public void sinisterButtonListener() { // Display the English translation in the Label. outputLabel.setText("left"); }
// Event listener for the dexterButton public void dexterButtonListener() { // Display the English translation in the Label. outputLabel.setText("right"); }
// Event listener for the mediumButton public void mediumButtonListener() { // Display the English translation in the Label. outputLabel.setText("center"); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started