A simple Morse Code Translator built in Java with both console and GUI versions. It converts between English text and Morse code, supporting letters, numbers, and punctuation.
-
Encode English text → Morse code
-
Decode Morse code → English text
-
Supports:
- Letters (A–Z)
- Numbers (0–9)
- Punctuation:
. , ? ! : ' " - / ( ) = @ &
-
Two implementations:
- Console app (
Main.java) - Swing GUI app (
MorseCodeTranslatorGUI.java)
- Console app (
morse-code-java/
│── src/
│ ├── Main.java # Console version
│ ├── Morse.java # Translator logic
│ └── MorseCodeTranslatorGUI.java # GUI version
│
├── README.md
├── .gitignore
└── LICENSE
git clone https://github.com/SpicyFalcon619/morse-code-java.git
cd morse-code-java/srcjavac Main.java Morse.java MorseCodeTranslatorGUI.javaConsole version:
java MainGUI version:
java MorseCodeTranslatorGUIEnter an English Text: HELLO WORLD
Morse: .... . .-.. .-.. --- / .-- --- .-. .-.. -..
Enter a Morse Code: .... . .-.. .-.. ---
Word: HELLO
The GUI provides a simple interface:
- Enter text in the Input box
- Click Translate to Morse or Translate to English
- Results appear in the Output box
- Use Clear to reset fields
Contributions are welcome! 🚀
- Fork this repo
- Create a feature branch
- Submit a pull request
This project is licensed under the MIT License.
