How would I design this Java program?
I want to design a special Java program that works like a code machine. I have already made the window layout for the program in a class called KeyTranslator. This program cannot do anything right now because it is missing the syntax that will process the user's input.
This is how it will work:
I have already made the layout of the program in BreezySwing, so I would like to try and keep to the BreezySwing syntax for the rest of the program. The window is arranged with two JTextArea objects and one JButton object. Each text area is at the top and bottom of the window with the button in between. The user will key whatever they want into the upper text area until the text is just as they want it. Then they will click the "Translate" button in the middle. Then the program must be able to evaluate each letter, number, or symbol that the user has keyed into the upper text area. It must then display what the user has just keyed into the bottom text area; only this time in a special code. I already know how the code is associated with different letters, numbers, and symbols.
The code that is displayed must be in the same order and position as the text that the user has entered.
What would the syntax for this program include?
Please note:
I have no experience with traditional GUI (AWT, Swing), so it would be highly advisable to use BreezySwing for the main part of this program. If that is not possible, lean more towards Swing and not towards complicated sets of classes.
Here is an example of how the program could work:
If the user input is 'helloworld', the program could somehow evaluate each letter in the string.
I thought that it might be able to use the length() method to determine the length of the string, and then somehow read each character in specific positions in the string. I have no clue if this is possible, but it would seperate the string into this:
h e l l o w o r l d
Each letter would have its own position in the string (h is 1; w is 6; d is 10) so that a set of if-else statements could determine what they are and construct a string of code to return to the user.