0% found this document useful (0 votes)
6 views17 pages

Java Microroject

The document presents a project report on a 'Morse Code Converter' developed by students at Sanjivani K.B.P. Polytechnic using Java programming. The project allows users to convert English text to Morse code and vice versa, incorporating features like audio playback for Morse code signals. It highlights the application of programming concepts such as string manipulation, data mapping, and GUI design, while also acknowledging the guidance and support received from faculty members.

Uploaded by

anushkajoshi7531
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views17 pages

Java Microroject

The document presents a project report on a 'Morse Code Converter' developed by students at Sanjivani K.B.P. Polytechnic using Java programming. The project allows users to convert English text to Morse code and vice versa, incorporating features like audio playback for Morse code signals. It highlights the application of programming concepts such as string manipulation, data mapping, and GUI design, while also acknowledging the guidance and support received from faculty members.

Uploaded by

anushkajoshi7531
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sanjivani Rural Education Society's

SANJIVANI K.B.P. POLYTECHNIC,KOARGAON


(2025-2026)

A PROJECT REORT ON

“Morse Code Converter”


Subject:-Java Programming (314317)
Submitted By:-
Roll No. Name Class

110 Joshi Anushka Amol SYCM-B

149 Nile Apurwa Gautam SYCM-B

131 Lasankar Sankruti Pramod SYCM-B

147 Nikam Payal Vijay SYCM-B

Guided By-Mr.K.P Jadhav Sir


DEPARTMNET OF COMPUTER TECHNOLOGY SANJIVANI K.B.P. POLYTECHNIC,KOARGAON
Sanjivani Rural Education Society's

SANJIVANI K.B.P. POLYTECHNIC,KOARGAON


(2025-2026)

CERTIFICATE
Subject:-Java Programming (314317)
Submitted By:-

Roll No. Name Class

110 Joshi Anushka Amol SYCM-B

149 Nile Apurwa Gautam SYCM-B

131 Lasankar Sankruti Pramod SYCM-B

147 Nikam Payal Vijay SYCM-B

"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."

PROJECT GUIDE HOD PRINCIPAL

Mr. K.P. Jadhav Mr.G.N. Jorvekar [Link]


ACKNOWLEDGEMENT

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.

Thank you so much!

[110] Anushka Joshi


[131] Sanskruti Lasankar
[147] Payal Nikam
[149] Apurwa Nile

Diploma in Computer Technology


Sanjivani K.B.P. Polytechnic, Kopargaon
Introduction

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.

In this project, we used basic Java concepts such as:

 Strings to handle text input and output,


 Loops and conditions to check and convert each letter,
 And a HashMap to store and match each letter with its Morse code.

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];

public class MorseCodeConverter {

private static final HashMap<Character, String> morseMap = new HashMap<>();

private static final HashMap<String, Character> reverseMorseMap = new HashMap<>();

static {

// Forward mapping

[Link]('A', ".-"); [Link]('B', "-...");

[Link]('C', "-.-."); [Link]('D', "-..");

[Link]('E', "."); [Link]('F', "..-.");

[Link]('G', "--."); [Link]('H', "....");

[Link]('I', ".."); [Link]('J', ".---");

[Link]('K', "-.-"); [Link]('L', ".-..");

[Link]('M', "--"); [Link]('N', "-.");

[Link]('O', "---"); [Link]('P', ".--.");

[Link]('Q', "--.-"); [Link]('R', ".-.");

[Link]('S', "..."); [Link]('T', "-");

[Link]('U', "..-"); [Link]('V', "...-");

[Link]('W', ".--"); [Link]('X', "-..-");

[Link]('Y', "-.--"); [Link]('Z', "--..");

[Link](' ', "/");

// Reverse mapping
for (Character key : [Link]()) {

[Link]([Link](key), key);

}}

public static String toMorse(String text) {

StringBuilder morse = new StringBuilder();

for (char c : [Link]().toCharArray()) {

String code = [Link](c);

if (code != null) {

[Link](code).append(" ");

} }

return [Link]().trim(); }

public static String toEnglish(String morseCode) {

StringBuilder english = new StringBuilder();

morseCode = [Link]().replaceAll("\\s+", " ");

String[] words = [Link](" / ");

for (String word : words) {

String[] chars = [Link](" ");

for (String symbol : chars) {

Character c = [Link](symbol);

if (c != null) {

[Link](c); }

[Link](" ");

}
return [Link]().trim();

[Link]
package MorseCodeTranslator;

import [Link].*;

public class MorseAudioPlayer {

public static void beep(int freq, int durationMs) {

try {

float sampleRate = 44100;

byte[] buf = new byte[1];

AudioFormat af = new AudioFormat(sampleRate, 8, 1, true, false);

SourceDataLine sdl = [Link](af);

[Link](af);

[Link]();

for (int i = 0; i < durationMs * (int) sampleRate / 1000; i++) {

double angle = i / (sampleRate / freq) * 2.0 * [Link];

buf[0] = (byte) ([Link](angle) * 40); // softer volume

[Link](buf, 0, 1);

[Link]();

[Link]();

[Link]();

} catch (Exception e) {

[Link]();
}

public static void sleep(int durationMs) {

try {

[Link](durationMs);

} catch (InterruptedException e) {

[Link]().interrupt();

public static void playMorse(String morseCode) {

for (char ch : [Link]()) {

switch (ch) {

case '.':

beep(800, 150); // dot

break;

case '-':

beep(800, 400); // dash

break;

case ' ':

sleep(200); // space between letters

continue;

case '/':

sleep(600); // space between words


continue;

sleep(100); // small pause after each symbol

public static void main(String[] args) {

[Link]("Testing dot beep...");

beep(800, 150);

[Link]("Testing dash beep...");

beep(800, 400); // dash: 800 Hz, 400 ms

[Link]
package MorseCodeTranslator;

import [Link].*;

import [Link].*;

public class MorseCodeGUI {

public static void main(String[] args) {

// Dark Mode Colors

Color bgColor = new Color(30, 30, 30);

Color fgColor = new Color(220, 220, 220);

Font monoFont = new Font("Consolas", [Link], 16);

JFrame frame = new JFrame("Morse Code Translator");


[Link](JFrame.EXIT_ON_CLOSE);

[Link](600, 450);

[Link](new BorderLayout(10, 10));

[Link]().setBackground(bgColor);

// Title

JLabel title = new JLabel("Morse Code Translator", [Link]);

[Link](new Font("SansSerif", [Link], 22));

[Link](fgColor);

[Link]([Link](10, 10, 10, 10));

[Link](title, [Link]);

// Input

JTextArea inputArea = new JTextArea(4, 30);

[Link](true);

[Link](true);

[Link](monoFont);

[Link](bgColor);

[Link](fgColor);

[Link]([Link](

[Link](fgColor),

[Link](10, 10, 10, 10)

));

JScrollPane inputScroll = new JScrollPane(inputArea);


// Output

JTextArea outputArea = new JTextArea(4, 30);

[Link](false);

[Link](true);

[Link](true);

[Link](monoFont);

[Link](bgColor);

[Link](fgColor);

[Link]([Link](

[Link](fgColor),

[Link](10, 10, 10, 10)

));

JScrollPane outputScroll = new JScrollPane(outputArea);

// Buttons

JButton toMorseButton = new JButton("To Morse");

JButton toEnglishButton = new JButton("To English");

JButton playButton = new JButton("🔊 Play Morse");

JButton clearButton = new JButton("Clear");

[Link](e -> {

String input = [Link]();

String output = [Link](input);

[Link](output);

});
[Link](e -> {

String input = [Link]();

String output = [Link](input);

[Link](output);

});

[Link](e -> {

String morse = [Link]();

if (![Link]()) {

new Thread(() -> [Link](morse)).start();

}); [Link](e -> {

[Link]("");

[Link]("");

}); // Live Preview on typing

[Link]().addDocumentListener(new
[Link]() {

public void changedUpdate([Link] e) {

update();

public void removeUpdate([Link] e) {

update();

}
public void insertUpdate([Link] e) {

update();

} public void update() {

String input = [Link]();

[Link]([Link](input)); }

}); // Panels

JPanel centerPanel = new JPanel(new GridLayout(2, 1, 15, 15));

[Link](bgColor);

[Link]([Link](10, 20, 10, 20));

[Link](inputScroll);

[Link](outputScroll);

JPanel buttonPanel = new JPanel();

[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.

You might also like