Try the fastest way to create flashcards
Question

Latin Translator

Look at the following list of Latin words and their meanings.

Latin English
sinister left
dexter right
medium center

Create a JavaFX application that translates the Latin words to English. The GUI should have three Buttons, one for each Latin word. When the user clicks a Button, the application should display the English translation in a Label.

Solution

Verified
Answered 6 months ago
Answered 6 months ago
Step 1
1 of 4
import javax.swing.*;

public class LatinTranslator {
    public static void main(String args[]) {

        JFrame f = new JFrame("Translator");
        f.setSize(600, 500);
        f.setLocation(200, 150);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JLabel label = new JLabel("Click the button to show its " 
        + "English translation.");
        label.setBounds(120, 20, 500, 30);

        JButton btn1 = new JButton("sinister");
        JButton btn2 = new JButton("dexter");
        JButton btn3 = new JButton("medium");
        btn1.setBounds(120, 80, 300, 50);
        btn2.setBounds(120, 160, 300, 50);
        btn3.setBounds(120, 240, 300, 50);

Create a free account to view solutions

Create a free account to view solutions

Recommended textbook solutions

Starting Out with Java: From Control Structures Through Objects 6th Edition by Tony Gaddis

Starting Out with Java: From Control Structures Through Objects

6th EditionISBN: 9780133957235Tony Gaddis
1,224 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
948 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionISBN: 9780262033848Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
872 solutions
Introduction to Algorithms 4th Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

4th EditionISBN: 9780262046305Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
945 solutions

More related questions

1/4

1/7