AJP Report2
AJP Report2
Micro-Project Proposal
⮚ Program survey
⮚ Writing algorithm
⮚ Preparing flowchart
⮚ Coding
⮚ Representation
⮚ Report preparation
1
4.0 Action Plan
SR. Details of activity Planned Start Planned Name of Responsible
No. date Finish date Team Members
1. Desktop pc – Windows 10
2
Annexure – II
Micro-Project Report
1.0 Rationale
The Online Auction Website project is designed to provide a platform where users can engage in real-
time auctions, offering a convenient and efficient way to buy and sell products. This project combines
web development with Java programming, giving students practical experience in creating dynamic,
interactive websites. The rationale behind developing this project is to:
1. Simulate the auction process, fostering a better understanding of e-commerce transactions.
2. Provide a hands-on approach to learning Java programming and web integration.
3. Explore the concepts of user authentication, bidding mechanisms, and real-time data updates.
4. Enhance problem-solving skills by addressing challenges like concurrency, data management,
and security.
3
4.0 Literature Review
Graphical User Interfaces (GUIs) and server-server socket communication are integral to
creating interactive and network-based software systems. In this context, GUIs are designed
to provide an accessible and user-friendly interface, while server-server socket communication
ensures real-time data transfer between the client and server, enabling dynamic, responsive
applications.
GUIs offer an intuitive way for users to interact with software by representing functions
through visual elements like buttons, labels, tables, and forms. Java Swing is one of the most
widely used libraries for building GUIs in Java applications. It provides a range of components
that make it easy to design responsive and interactive interfaces for desktop applications.
For instance, in your application, the use of JFrame, JTextField, JButton, JLabel, and JTable
provides a structured and organized way to input and display data for auction items, bids, and
auction results. The GUI ensures that the administrator can add items, manage auctions, and
visualize data in a clean, accessible format. For the client, the GUI facilitates interaction with
the bidding system by allowing users to place bids, view item details, and monitor the auction's
progress.
Server-socket communication is essential for enabling real-time interaction between the client
and server applications over a network. Java provides an efficient Socket and ServerSocket
API for building networked applications that can exchange data over the Transmission Control
Protocol (TCP). TCP ensures that data packets are delivered in order and without error, making
it an ideal choice for auction systems, where accurate and timely data exchange is critical.
In your application, the server listens for client connections on a specified port using
ServerSocket. Once a connection is established, Socket is used to facilitate communication
between the server and client. The server receives bid information from clients, processes it,
and sends relevant updates back to ensure synchronization between all connected clients. This
real-time exchange enables an efficient auction system where bids can be placed, and results
can be displayed dynamically, ensuring a seamless experience for users.
4
5.0 Actual Procedure Followed
ALGORITHM:
Step 1: Start.
Step 2: Admin enters the item name, price, and selects an image.
Step 3: Admin presses "Add Item" or "Close".
Step 4:
If Add Item is pressed, the item will be added to the auction table.
If Close is pressed, the current window will close.
Step 5: Admin presses "Start Auction".
Step 6: The timer starts for a 1-minute countdown and the item details are displayed on the client
panel.
Step 7: Client enters their name and bid price.
Step 8: Client presses "Place Bid".
Step 9: If bid details are valid, the bid is submitted and shown in the auction table on the admin
panel.
Step 10: Once the timer ends, the system checks all bids.
Step 11: The system declares the highest bid as the winner.
Step 12: The auction ends and results are displayed.
Step 13: Admin can close the auction or restart.
Step 14: Stop.
5
FLOWCHART:
6
Code
1) Server.java
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public Server() {
// Set frame properties
setTitle("Admin Panel");
setSize(600, 400);
setLayout(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
7
// Select Image Button
selectImageButton = new JButton("SELECT IMAGE");
selectImageButton.setBounds(120, 100, 150, 30);
add(selectImageButton);
// Timer label
timerLabel = new JLabel("TIMER: 01:00");
timerLabel.setBounds(400, 20, 150, 30);
timerLabel.setFont(new Font("Arial", Font.BOLD, 14));
add(timerLabel);
// Close Button
closeButton = new JButton("CLOSE");
closeButton.setBounds(340, 320, 100, 30);
add(closeButton);
8
startAuctionButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
startAuction();
}
});
closeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
closeAuction();
}
});
}
9
}
});
auctionTimer.start();
}
if (winner != null) {
JOptionPane.showMessageDialog(this, "The winner is " + winner + " with a bid of $" +
highestBid + " for " + itemSoldAt, "Auction Result", JOptionPane.INFORMATION_MESSAGE);
} else {
JOptionPane.showMessageDialog(this, "No bids were placed.", "Auction Result",
JOptionPane.INFORMATION_MESSAGE);
}
}
10
private void closeAuction() {
System.exit(0);
}
2) Client.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.net.Socket;
public Client() {
// Set frame properties
setTitle("Customer Panel");
setSize(600, 400);
setLayout(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
11
JLabel bidderNameLabel = new JLabel("BIDDER NAME:");
bidderNameLabel.setBounds(20, 20, 100, 30);
add(bidderNameLabel);
// Timer label
timerLabel = new JLabel("TIMER: AUCTION NOT STARTED!");
timerLabel.setBounds(400, 20, 200, 30);
timerLabel.setFont(new Font("Arial", Font.BOLD, 14));
add(timerLabel);
// Item details
itemNameLabel = new JLabel("ITEM NAME:");
itemNameLabel.setBounds(320, 60, 100, 30);
add(itemNameLabel);
12
// Close Button
closeButton = new JButton("CLOSE");
closeButton.setBounds(460, 320, 100, 30);
add(closeButton);
// Action listeners
addBidButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
placeBid();
}
});
closeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
closeClient();
}
});
13
String bidderName = bidderNameField.getText();
String bidPrice = bidPriceField.getText();
// Method to start the auction timer and update UI with item details
private void startAuction() {
auctionTimer = new Timer(1000, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
timeLeft--;
updateTimer();
if (timeLeft == 0) {
auctionTimer.stop();
JOptionPane.showMessageDialog(null, "Auction Ended!", "Info",
JOptionPane.INFORMATION_MESSAGE);
}
}
});
auctionTimer.start();
14
timerLabel.setText(String.format("TIMER: %02d:%02d", minutes, seconds));
}
1. Desktop pc – Windows 10 1
15
7.0 Outputs of the Micro-Projects
16
8.0 Skill Developed / learning out of this Micro-Project
The following skills were developed while performing and developing this micro project:
● Designing: Designing of micro projects with minimum required resources and at low cost.
● Teamwork: Learned to work in a team and boost individual confidence.
● Time Management: Timely completion of micro project as scheduled.
● Data Analysis: Analyzing the data collected during the processes.
● Interpretation of Data: Drawing and analysis of graphs, laboratory calculations etc.
● Problem-solving: Develop good problem-solving habits.
● Technical writing: Preparing a report of the proposed plan and final report.
In this micro-project, the Graphical User Interface (GUI) is developed using Java's Swing framework,
allowing for an interactive platform where users can input data and trigger various events through
components like buttons, text fields, and checkboxes. Swing provides a lightweight, platform-
independent interface that enhances user interaction. The GUI serves as a bridge between the user and
the underlying functionalities of the application, making it intuitive and easy to navigate. Additionally,
the project involves implementing server and server socket programming to establish a network-based
communication system. A ServerSocket is created to listen for client connections, enabling the server
to handle requests, send responses, and maintain a steady connection with the client. This enables the
program to handle multiple client requests and create a reliable communication channel for data
transfer, demonstrating the core concepts of Java networking and server-client interaction.
17
Annexure – III
18
Annexure – IV
Sr. Poor
No Characteristic to be Average (Marks Good Excellent (
( Marks 1- Sub Total
. assessed 3)
4-5 ) (Marks 6-8) Mark 9-10)
(A) Process and Product Assessment (Convert Above Total marks out of 6 Marks)
6 Quality of Prototype/Model
7 Report Preparation
(B) Individual Presentation / Viva (Convert above total marks out of 4 marks)
8 Presentation
9 Defense
19
Process and Product Individual Presentation / Total Marks
Roll No.
Assessment (6 Marks) Viva (4 Marks) 10
70
71
Name and designation of the Teacher: Mrs. Pratibha Pednekar (Lecturer) Dated
Signature:
20