Morse Code Converter Project in Java
Morse Code Converter Project in Java
A PROJECT REORT ON
CERTIFICATE
Subject:-Java Programming (314317)
Submitted By:-
"This is to certify that the micro project titled "Morse Code Converter" has been completed
under our supervision and guidance, in partial fulfillment of the requirements for the Diploma
in Computer Technology, affiliated to the Maharashtra State Board of Technical Education
(MSBTE), Mumbai, for the academic year 2023–2024."
First and foremost, we express our deep sense of gratitude and sincere thanks to our project
guide, Mr. K. P. Jadhav, Department of Computer Technology, Sanjivani K.B.P. Polytechnic,
Kopargaon. His availability throughout the year, valuable guidance, opinions, suggestions,
constructive criticism, encouragement, and support have tremendously boosted the quality of
our project work.
We also extend our heartfelt thanks to Mr. G. N. Jorvekar, Head of the Computer Technology
Department, for his constant support and motivation during this project.
We are grateful to our respected Principal, Prof. A. R. Mirikar, Sanjivani K.B.P. Polytechnic,
Kopargaon, for providing us with a great platform and environment to complete the project
within the scheduled time.
We would also like to thank all the faculty members of the Computer Technology Department
for their helpful comments, encouragement, and assistance during the course of this project.
Last but not the least, we sincerely thank our families and friends for their unconditional love,
help, and constant support in countless ways throughout this journey.
This micro project is titled "Morse Code Converter" and is made using the Java
programming language. The main purpose of this project is to create a simple tool that can
change normal English text into Morse code, and also convert Morse code back into
English text. This helps users understand how text messages can be sent in a different form
using dots and dashes.
Morse code is a way of sending messages using short and long signals — called dots (.) and
dashes (-). It was first used many years ago in telegraphs and during wars to send secret or
quick messages. Even today, Morse code is useful in areas like airplanes, ships, emergency
situations, and amateur radio, because it is easy to use and works well when voice or regular
text is not possible.
The program is run using the command line (console). The user types in either English text or
Morse code, and the program quickly shows the converted message.
This project helped us understand how real-world systems like secret codes and communication
methods can be built using simple programming. We also improved our knowledge of Java,
and learned how to write clean, working code. It was a fun and interesting experience that
showed us how useful and powerful even a small project can be.
Block dig
FLOWCHART:-
Code:-
[Link]
package MorseCodeTranslator;
import [Link];
static {
// Forward mapping
// Reverse mapping
for (Character key : [Link]()) {
[Link]([Link](key), key);
}}
if (code != null) {
[Link](code).append(" ");
} }
return [Link]().trim(); }
Character c = [Link](symbol);
if (c != null) {
[Link](c); }
[Link](" ");
}
return [Link]().trim();
[Link]
package MorseCodeTranslator;
import [Link].*;
try {
[Link](af);
[Link]();
[Link](buf, 0, 1);
[Link]();
[Link]();
[Link]();
} catch (Exception e) {
[Link]();
}
try {
[Link](durationMs);
} catch (InterruptedException e) {
[Link]().interrupt();
switch (ch) {
case '.':
break;
case '-':
break;
continue;
case '/':
beep(800, 150);
[Link]
package MorseCodeTranslator;
import [Link].*;
import [Link].*;
[Link](600, 450);
[Link]().setBackground(bgColor);
// Title
[Link](fgColor);
[Link](title, [Link]);
// Input
[Link](true);
[Link](true);
[Link](monoFont);
[Link](bgColor);
[Link](fgColor);
[Link]([Link](
[Link](fgColor),
));
[Link](false);
[Link](true);
[Link](true);
[Link](monoFont);
[Link](bgColor);
[Link](fgColor);
[Link]([Link](
[Link](fgColor),
));
// Buttons
[Link](e -> {
[Link](output);
});
[Link](e -> {
[Link](output);
});
[Link](e -> {
if (![Link]()) {
[Link]("");
[Link]("");
[Link]().addDocumentListener(new
[Link]() {
update();
update();
}
public void insertUpdate([Link] e) {
update();
[Link]([Link](input)); }
}); // Panels
[Link](bgColor);
[Link](inputScroll);
[Link](outputScroll);
[Link](bgColor);
[Link](toMorseButton);
[Link](toEnglishButton);
[Link](playButton);
[Link](clearButton);
[Link](centerPanel, [Link]);
[Link](buttonPanel, [Link]);
[Link](true);
}
Sample Output:-
CONCLUSION
The Morse Code Translator project successfully demonstrates the integration of GUI
interaction, data processing, and audio feedback using Java. It enables users to convert English
text into Morse code and vice versa with ease. Additionally, the implementation of the audio
module enhances user experience by allowing playback of Morse code using beeps, mimicking
real-world Morse transmissions.
Through this project, key programming concepts such as string manipulation, data mapping
using HashMap, audio signal generation, and event-driven GUI design were effectively applied.
This project not only provides a functional and user-friendly tool but also serves as a solid
foundation for further enhancements like adding support for numerals, punctuation, or
international Morse variations.