0% found this document useful (0 votes)
43 views31 pages

AJP Report Msbte 5th Sem

quiz application using java swing ....
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)
43 views31 pages

AJP Report Msbte 5th Sem

quiz application using java swing ....
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
You are on page 1/ 31

Anjuman-I-Islam

M.H. Saboo Siddik Polytechnic

ADVANCED JAVA PROGRAMMING


(AJP)
Microproject
Computer Engineering
Department
Co-5i
Title: TALK TAUH
Year: 2024-25
PREPARED BY:
▪ 220408: Saeed Ansari
▪ 220413: Fawwaz Shaikh
▪ 220416: Ganesh Jaiswar
▪ 220419: Aman Khan

Under the guidance of: Prof. Ghazala Khan


MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

Certificate
This is to certify that Mr. Ansari Saeed Roll no. 220408 of
fourth semester of Diploma in Computer Engineering of
institute M.H. Saboo Siddik Polytechnic(code:0002) has
completed microproject satisfactorily in the subject: AJP
(22517) for the academic year 2024-25 as prescribed in the
curriculum.

Place: Mumbai Enrolment no: 2200020320


Date: ______________ Exam seat no:

Signature Signature Signature


Project guide H. O. D Principal

SEAL OF
INSTITUDE
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

Certificate
This is to certify that Mr. Fawwaz Shaikh Roll no. 220413
of fourth semester of Diploma in Computer Engineering of
institute M.H. Saboo Siddik Polytechnic(code:0002) has
completed microproject satisfactorily in the subject: AJP
(22517) for the academic year 2024-25 as prescribed in the
curriculum.

Place: Mumbai Enrolment no: 2200020362


Date: ______________ Exam seat no:

Signature Signature Signature


Project guide H. O. D Principal

SEAL OF
INSTITUDE
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

Certificate
This is to certify that Mr. Aman Khan Roll no. 220419 of
fourth semester of Diploma in Computer Engineering of
institute M.H. Saboo Siddik Polytechnic(code:0002) has
completed microproject satisfactorily in the subject: AJP
(22517) for the academic year 2024-25 as prescribed in the
curriculum.

Place: Mumbai Enrolment no: 2200020359


Date: ______________ Exam seat no:

Signature Signature Signature


Project guide H. O. D Principal

SEAL OF
INSTITUDE
MAHARASHTRA STATE
BOARD OF TECHNICAL EDUCATION

Certificate
This is to certify that Mr. Ganesh Jaiswar Roll no. 220416
of fourth semester of Diploma in Computer Engineering of
institute M.H. Saboo Siddik Polytechnic(code:0002) has
completed microproject satisfactorily in the subject: AJP
(22517) for the academic year 2024-25 as prescribed in the
curriculum.

Place: Mumbai Enrolment no: 2200020365


Date: ______________ Exam seat no:

Signature Signature Signature


Project guide H. O. D Principal

SEAL OF
INSTITUDE
Acknowledgment
We wish to express our profound gratitude to our guide Prof. GHAZALA KHAN
who guided us endlessly in the framing and completion of the micro project. He
guided us on all the main points in that micro project. We are indebted to his/her
constant encouragement, cooperation, and help. It was his/her enthusiastic
support that helped us in overcoming various obstacles in the micro-project.

We are also thankful to our Principal, HOD, faculty members and classmates of
COMPUTER ENGINEERING department for extending their support and motivation
in the completion of this micro-project.

Names of Team Members with Roll Nos.

1. SAEED ANSARI - 220408

2. FAWWAZ SHAIKH - 220413

3. GANESH JAISWAR - 220416

4. AMAN KHAN - 220419


Annexure-I
Microproject proposal
Title of microproject: Talk Tauh

I. Aims/Benefits of microproject
A Java Talk Tuah microproject provides hands-on experience with real-time text
communication, focusing on networking, multithreading, and client-server architecture.
It teaches managing simultaneous connections, secure data transmission, and real-time
responsiveness. Key benefits include mastering Java's Socket programming, TCP/IP
protocols, concurrency with threads, and UI design, while enhancing skills in secure,
scalable software development.

II. Course outcomes addressed

• Develop programs using GUI Framework (AWT and Swing) .


• Handle events of AWT and Swings components .
• Develop programs to handle events in Java Programming .
• Develop Java programs using networking concepts .
• Develop programs using database .
• Develop programs using Servlets .

III. Proposed methodology

1. To search the information about the project. (Collect relevant data from different
sources (books/internet/market/suppliers/experts and others through
surveys/interviews etc.).
2. To collect all relevant content / materials to complete the project.
3. To prepare the report of micro project.
4. To deliver presentation/ appear for viva-voice

✓ Discussion of the given topic among group members.


✓ Literature survey
✓ Submission of project proposal
✓ Analysis of data
✓ Work divided among group members
✓ Compilation of content
✓ Representation
✓ Editing the content as per the instructions
✓ Report Preparation
✓ Viva and presentation
Annexure-I
IV. Action Plan
Planned Name of
Planned
Weeks Details of activity finish responsible
start date
date team members

Discussions & finalization of topics Saeed,


1& 2 Fawwaz , Aman
Ganesh

3 Preparation of abstract Fawwaz , Saeed

4 Literature review Aman , Ganesh

Submission of microproject proposal(Annexure -I) Saeed,


5 Fawwaz , Aman
Ganesh

6 Collection of information on given topic Fawwaz

7 Collection of all relevant contents Fawwaz , Saeed

8 Discussion and submission of outline of the project Aman , Ganesh

Analysis/execution of collected data/information and Saeed


9 Preparation of prototypes/drawings/charts/graphs/
Fawwaz , Aman
tables/models/circuits/programs etc.
Ganesh

10 Compilation of contents of project Ganesh

11 Compilation of weekly progress report Fawwaz

12 Preparation of the project report (Annexure II) Aman , Ganesh

13 Viva Voce / Delivery of presentation. Saeed


Fawwaz , Aman
Ganesh

V. Resources required

Name of
Sr. no. Specifications Qty Remarks
resources
Learning resources and
1. Online 3 sites
various websites
Microsoft word, Tools with
2. Desktop 1 for each
internet facility.
Names of Team Members with Roll Nos.

1. SAEED ANSARI - 220408

2. FAWWAZ SHAIKH - 220413

3. GANESH JAISWAR - 220416

4. AMAN KHAN - 220419

Approved by:
Sign of Faculty:
Name of faculty: PROF. GHAZALA KHAN
Annexure-II
Microproject Report
Title of Micro-project: Talk Tuah
I. Rationale

The rationale for developing a Talk Tuah in a Java microproject is to provide practical
experience in building a real-time communication system, which is vital in modern
networking and distributed applications. It allows learners to apply key Java concepts
such as socket programming, multithreading, and client-server architecture in a hands-
on manner, simulating real-world scenarios where multiple users exchange data
concurrently. This project strengthens the understanding of managing network
connections, data synchronization, and handling errors while also introducing
essential security concepts. Ultimately, it equips developers with the skills to build
scalable, efficient systems and prepares them for more advanced, real-world
software development.

II. Aims/Benefits of microproject


A Java Talk Tuah microproject provides hands-on experience with real-time text
communication, focusing on networking, multithreading, and client-server architecture.
It teaches managing simultaneous connections, secure data transmission, and real-time
responsiveness. Key benefits include mastering Java's Socket programming, TCP/IP
protocols, concurrency with threads, and UI design, while enhancing skills in secure,
scalable software development.

III. Course outcomes achieved

✓ Develop programs using GUI Framework (AWT and Swing) .


✓ Handle events of AWT and Swings components .
✓ Develop programs to handle events in Java Programming .
✓ Develop Java programs using networking concepts .
✓ Develop programs using database .
✓ Develop programs using Servlets .

IV. Literature review

Talk Tuah in Java highlights key areas such as socket programming for client-server
communication using TCP/IP protocols, and multithreading for handling multiple
client connections simultaneously. Research emphasizes the importance of client-
server architecture for scalable distributed systems and explores the role of UI design
through tools like Swing and JavaFX. Security studies focus on encryption techniques
such as SSL/TLS for secure communication, while data transmission efficiency is
improved using data serialization methods. These studies provide foundational
knowledge for building efficient and secure chat systems.
V. Actual Methodology Followed

We were assigned with the microproject topic and time was assigned to us to complete
the project in 11 weeks. All team members worked together in these 11 weeks together
in order to complete this microproject. Data was collected according to our topic.
Presentation was prepared and finally at last technical report was prepared.

VI. Actual resources used

Name of
Sr. no. Specifications Qty Remarks
resources
1. Software MS-Word 1 for each
www.geeksforgeeks.com,
2. Websites www.tutorialspoint.com, 1 for each

VII. Outputs of the microproject


TOPIC : TALK TUAH

INTRODUCTION TO TALK TUAH :

• TALK TUAH Project is a straightforward, real-time chat application focused


exclusively on enabling seamless communication between users. Designed
with simplicity in mind, the project revolves around a clean interface that
allows users to send and receive messages instantly. Whether for personal or
group conversations, TALK TUAH ensures reliable and fast messaging, with an
emphasis on user-friendly interaction and intuitive design, making it accessible
for both casual users and professional use cases.

CODE :

• MAIN CHAT APP COMPONENT :

import React, { useEffect, useState } from 'react'

import {over} from 'stompjs';

import SockJS from 'sockjs-client';

var stompClient =null;

const ChatRoom = () => {

const [privateChats, setPrivateChats] = useState(new Map());

const [publicChats, setPublicChats] = useState([]);

const [tab,setTab] =useState("CHATROOM");

const [userData, setUserData] = useState({

username: '',

receivername: '',

connected: false,

message: ''

});

useEffect(() => {

console.log(userData);

}, [userData]);
const connect =()=>{

let Sock = new SockJS('http://localhost:8080/ws');

stompClient = over(Sock);

stompClient.connect({},onConnected, onError);

const onConnected = () => {

setUserData({...userData,"connected": true});

stompClient.subscribe('/chatroom/public', onMessageReceived);

stompClient.subscribe('/user/'+userData.username+'/private', onPrivateMessage);

userJoin();

const userJoin=()=>{

var chatMessage = {

senderName: userData.username,

status:"JOIN"

};

stompClient.send("/app/message", {}, JSON.stringify(chatMessage));

const onMessageReceived = (payload)=>{

var payloadData = JSON.parse(payload.body);

switch(payloadData.status){

case "JOIN":

if(!privateChats.get(payloadData.senderName)){

privateChats.set(payloadData.senderName,[]);

setPrivateChats(new Map(privateChats));

break;

case "MESSAGE":

publicChats.push(payloadData);

setPublicChats([...publicChats]);
break;

const onPrivateMessage = (payload)=>{

console.log(payload);

var payloadData = JSON.parse(payload.body);

if(privateChats.get(payloadData.senderName)){

privateChats.get(payloadData.senderName).push(payloadData);

setPrivateChats(new Map(privateChats));

}else{

let list =[];

list.push(payloadData);

privateChats.set(payloadData.senderName,list);

setPrivateChats(new Map(privateChats));

const onError = (err) => {

console.log(err);

const handleMessage =(event)=>{

const {value}=event.target;

setUserData({...userData,"message": value});

const sendValue=()=>{

if (stompClient) {

var chatMessage = {

senderName: userData.username,

message: userData.message,

status:"MESSAGE"

};
console.log(chatMessage);

stompClient.send("/app/message", {}, JSON.stringify(chatMessage));

setUserData({...userData,"message": ""});

const sendPrivateValue=()=>{

if (stompClient) {

var chatMessage = {

senderName: userData.username,

receiverName:tab,

message: userData.message,

status:"MESSAGE"

};

if(userData.username !== tab){

privateChats.get(tab).push(chatMessage);

setPrivateChats(new Map(privateChats));

stompClient.send("/app/private-message", {}, JSON.stringify(chatMessage));

setUserData({...userData,"message": ""});

const handleUsername=(event)=>{

const {value}=event.target;

setUserData({...userData,"username": value});

const registerUser=()=>{

connect();

return (

<div className="container">
{userData.connected?

<div className="chat-box">

<div className="member-list">

<ul>

<li onClick={()=>{setTab("CHATROOM")}} className={member


${tab==="CHATROOM" && "active"}}>Chatroom</li>

{[...privateChats.keys()].map((name,index)=>(

<li onClick={()=>{setTab(name)}} className={member ${tab===name &&


"active"}} key={index}>{name}</li>

))}

</ul>

</div>

{tab==="CHATROOM" && <div className="chat-content">

<ul className="chat-messages">

{publicChats.map((chat,index)=>(

<li className={message ${chat.senderName === userData.username && "self"}}


key={index}>

{chat.senderName !== userData.username && <div


className="avatar">{chat.senderName}</div>}

<div className="message-data">{chat.message}</div>

{chat.senderName === userData.username && <div className="avatar


self">{chat.senderName}</div>}

</li>

))}

</ul>

<div className="send-message">

<input type="text" className="input-message" placeholder="enter the message"


value={userData.message} onChange={handleMessage} />

<button type="button" className="send-button" onClick={sendValue}>send</button>

</div>

</div>}

{tab!=="CHATROOM" && <div className="chat-content">

<ul className="chat-messages">

{[...privateChats.get(tab)].map((chat,index)=>(

<li className={message ${chat.senderName === userData.username && "self"}}


key={index}>
{chat.senderName !== userData.username && <div
className="avatar">{chat.senderName}</div>}

<div className="message-data">{chat.message}</div>

{chat.senderName === userData.username && <div className="avatar


self">{chat.senderName}</div>}

</li>

))}

</ul>

<div className="send-message">

<input type="text" className="input-message" placeholder="enter the message"


value={userData.message} onChange={handleMessage} />

<button type="button" className="send-button"


onClick={sendPrivateValue}>send</button>

</div>

</div>}

</div>

<div className="register">

<input

id="user-name"

placeholder="Enter your name"

name="userName"

value={userData.username}

onChange={handleUsername}

margin="normal"

/>

<button type="button" onClick={registerUser}>

connect

</button>

</div>}

</div>

}
• ABOVE IS APP JS :

import React from 'react'

import ChatRoom from './components/ChatRoom'

const App = () => {

return (

<ChatRoom />

export default App;

• CSS FOR FRONTEND :

body {

margin: 0;

font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',

'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',

sans-serif;

-webkit-font-smoothing: antialiased;

-moz-osx-font-smoothing: grayscale;

code {

font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',

monospace;

input {

padding: 10px;

font-size: 1.2em;

button{
border: none;

padding: 10px;

background: green;

color:#fff;

font-size: 1.2em;

font-weight: bold;

.container{

position: relative;

.register{

position: fixed;

padding:30px;

box-shadow:0 2.8px 2.2px rgba(0, 0, 0, 0.034),0 6.7px 5.3px rgba(0, 0, 0, 0.048),0 12.5px 10px
rgba(0, 0, 0, 0.06),0 22.3px 17.9px rgba(0, 0, 0, 0.072),0 41.8px 33.4px rgba(0, 0, 0, 0.086),0 100px
80px rgba(0, 0, 0, 0.12);

top:35%;

left:32%;

display: flex;

flex-direction: row;

.chat-box{

box-shadow:0 2.8px 2.2px rgba(0, 0, 0, 0.034),0 6.7px 5.3px rgba(0, 0, 0, 0.048),0 12.5px 10px
rgba(0, 0, 0, 0.06),0 22.3px 17.9px rgba(0, 0, 0, 0.072),0 41.8px 33.4px rgba(0, 0, 0, 0.086),0 100px
80px rgba(0, 0, 0, 0.12);

margin:40px 50px;

height: 600px;

padding: 10px;

display: flex;

flex-direction: row;

}
.member-list{

width: 20%;

.chat-content{

width:80%;

margin-left: 10px;

.chat-messages{

height: 80%;

border: 1px solid #000;

.send-message{

width: 100%;

display: flex;

flex-direction: row;

.input-message{

width:90%;

border-radius: 50px;

ul {

padding: 0;

list-style-type: none;

.send-button{

width:10%;

border-radius: 50px;

margin-left: 5px;

cursor: pointer;
}

.member{

padding: 10px;

background: #eee;

border:#000;

cursor: pointer;

margin: 5px 2px;

box-shadow: 0 8px 8px -4px lightblue;

.member.active{

background: blueviolet;

color:#fff;

.member:hover{

background: grey;

color:#fff;

.avatar{

background-color: cornflowerblue;

padding: 3px 5px;

border-radius: 5px;

color:#fff;

.avatar.self{

color:#000;

background-color: greenyellow;

.message{

padding:5px;

width: auto;

display: flex;

flex-direction: row;

box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);


margin: 5px 10px;

.message-data{

padding:5px;

.message.self{

justify-content: end;

• CONFIQ JAVA :

package com.involveininnovation.chat.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws").setAllowedOriginPatterns("*").withSockJS();
}

@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/app");
registry.enableSimpleBroker("/chatroom","/user");
registry.setUserDestinationPrefix("/user");
}
}

• CONTROLLER :

package com.involveininnovation.chat.controller;

import com.involveininnovation.chat.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Controller;

@Controller
public class ChatController {

@Autowired
private SimpMessagingTemplate simpMessagingTemplate;

@MessageMapping("/message")
@SendTo("/chatroom/public")
public Message receiveMessage(@Payload Message message){
return message;
}

@MessageMapping("/private-message")
public Message recMessage(@Payload Message message){

simpMessagingTemplate.convertAndSendToUser(message.getReceiverName(),"/private",message);
System.out.println(message.toString());
return message;
}
}

• MESSAGE :

package com.involveininnovation.chat.model;

import lombok.*;

import java.util.Date;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@ToString
public class Message {
private String senderName;
private String receiverName;
private String message;
private String date;
private Status status;
}

• STATUS :

package com.involveininnovation.chat.model;

public enum Status {


JOIN,
MESSAGE,
LEAVE
}
• TALK TUAH :

package com.involveininnovation.chat;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class ChatApplication {

public static void main(String[] args) {


SpringApplication.run(ChatApplication.class, args);
}

• TALK TUAH TEST.JAVA :

package com.involveininnovation.chat;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class ChatApplicationTests {

@Test
void contextLoads() {
}

}
OUTPUT :
CONCLUSION

In conclusion, developing a TALK TUAH in Java as a microproject provides


valuable hands-on experience in implementing real-time communication
systems. It strengthens understanding of essential concepts such as networking,
multithreading, and client-server architecture, while also addressing challenges
related to data transmission, error handling, and security. This project not only
helps in building technical skills but also prepares developers for creating
scalable, efficient, and secure applications that are widely applicable in modern
digital communication platforms. Ultimately, it serves as a foundational step
toward more complex, distributed systems in the future.
VIII. Skills developed/ Learning outcomes

- DATA COLLECTION - Collect relevant data from different sources (books/the internet/the
market/suppliers/experts and others through surveys/interviews)

- TEAMWORK - Learning to work in team and boost individual confidence.

- TIME MANAGEMENT - Completion of microproject as scheduled.

- TECHNICAL WRITING - Preparing a report of proposed plan and report.

- PRESENTATION AND COMMUNICATION SKILLS - Giving working model presentation of


the micro project.

- CONFIDENCE - Confidently, answer the questions asked about the project.

IX. Applications of this microproject

- REAL-TIME COMMUNICATION PLATFORMS : It forms the foundation for developing chat


services like messaging apps, customer support chatbots, or group chat systems used in
businesses and social platforms.

- COLLABORATIVE TOOLS: It can be integrated into collaborative tools for remote teams,
allowing instant communication alongside project management and file sharing.

- EDUCATIONAL PURPOSES : Useful in classrooms or e-learning environments where


teachers and students can communicate instantly.

- ONLINE GAMING : Enables real-time communication among players in multiplayer


games.

- CUSTOMER SUPPORT SYSTEMS : Provides a basis for live chat systems used in e-
commerce or service websites where customers can get assistance in real-time.
Micro Project Evaluation Sheet

Name of student: Ansari Saeed Enrolment no: 2200020320


Name of programme: Computer Engineering Semester: 5th
Course title: Advanced Java Programming(AJP) Code: 22517
Title of microproject: Chat App
Course outcomes achieved:
• Develop programs using GUI Framework (AWT and Swing) .
• Handle events of AWT and Swings components .
• Develop programs to handle events in Java Programming .
• Develop Java programs using networking concepts .
• Develop programs using database .
• Develop programs using Servlets .

Comments/Suggestions about teamwork/leadership/interpersonal communication


___________________________________________________________________________
___________________________________________________________________________

Name and designation of teacher: _____________________________________________


Dated signature: ______________________
Micro Project Evaluation Sheet

Name of student: Fawwaz Shaikh Enrolment no: 2200020362


Name of programme: Computer Engineering Semester: 5th
Course title: Advanced Java Programming(AJP) Code: 22517
Title of microproject: Chat App
Course outcomes achieved:
• Develop programs using GUI Framework (AWT and Swing) .
• Handle events of AWT and Swings components .
• Develop programs to handle events in Java Programming .
• Develop Java programs using networking concepts .
• Develop programs using database .
• Develop programs using Servlets .

Comments/Suggestions about teamwork/leadership/interpersonal communication


___________________________________________________________________________
___________________________________________________________________________

Name and designation of teacher: _____________________________________________


Dated signature: ______________________
Micro Project Evaluation Sheet

Name of student: Ganesh Jaiswar Enrolment no: 2200020365


Name of programme: Computer Engineering Semester: 5th
Course title: Advanced Java Programming(AJP) Code: 22517
Title of microproject: Chat App
Course outcomes achieved:
• Develop programs using GUI Framework (AWT and Swing) .
• Handle events of AWT and Swings components .
• Develop programs to handle events in Java Programming .
• Develop Java programs using networking concepts .
• Develop programs using database .
• Develop programs using Servlets .

Comments/Suggestions about teamwork/leadership/interpersonal communication


___________________________________________________________________________
___________________________________________________________________________

Name and designation of teacher: _____________________________________________


Dated signature: ______________________
Micro Project Evaluation Sheet

Name of student: Aman Khan Enrolment no: 2200020359


Name of programme: Computer Engineering Semester: 5th
Course title: Advanced Java Programming(AJP) Code: 22517
Title of microproject: Chat App
Course outcomes achieved:
• Develop programs using GUI Framework (AWT and Swing) .
• Handle events of AWT and Swings components .
• Develop programs to handle events in Java Programming .
• Develop Java programs using networking concepts .
• Develop programs using database .
• Develop programs using Servlets .

Comments/Suggestions about teamwork/leadership/interpersonal communication


___________________________________________________________________________
___________________________________________________________________________

Name and designation of teacher: _____________________________________________


Dated signature: ______________________

You might also like