Ajp 24
Ajp 24
A STUDY ON
Group Number: 24
Sr. Roll
Name Enrollment No Seat No
No No
Certificate
This is to certify that Mr. / Ms. _______________________________________
Dhule (Institute Code: 0059) has completed the Micro Project satisfactorily in
Seal of
institute
MAHARASHTRA STATE BOARD OF TECHNICAL
EDUCATION, MUMBAI
Certificate
This is to certify that,
Roll No Enrollment No Name Exam Seat No.
Seal of
institute
Part A: Micro-Project Proposal
Title: Currency converter INR ₹ to USD $
1.0 Introduction:
This project aims to create a calculator application using Java's Swing framework, providing
a user-friendly interface for performing basic mathematical operations. The application will
feature buttons for numbers and operations making it suitable for a wide range of users.
By developing this calculator, we will enhance our understanding of Java programming and
GUI design, demonstrating key concepts such as event handling and user interaction.
Ultimately, this project serves as a practical tool for learning and applying programming
skills in a real-world application.
4.0Literature Review:
Java Swing is a popular toolkit for building platform-independent GUI applications, offering
components like JFrame, JButton, and JTextField, which are ideal for creating a simple
calculator. Swing's flexibility and event-driven model, based on ActionListener, make it
suitable for handling user interactions efficiently. Previous research and tutorials demonstrate
how Swing enables the development of functional calculators by managing button events and
real-time display updates. This project builds on established principles of GUI design and
event-driven programming to create an interactive desktop calculator using Java Swing.
5.0Proposed Methodology:
For our Java Swing-based calculator project, start by defining the basic operations (addition,
subtraction, multiplication, and division). Use JFrame as the main window, with a JTextField
for the display and JButtons for numbers and operators, arranged using a GridLayout for
proper alignment. Each button should trigger an action through ActionListener to update the
display or perform calculations.
In implementation, focus on designing a class structure with a main class (e.g.,
CalculatorApp) that extends JFrame, handling button clicks and ensuring correct calculation
logic. Thoroughly test the functionality, including edge cases like dividing by zero or
handling large numbers.
Sr. Name of
Specifications Quantity Remarks
No. Resource/Material
import javax.swing.*;
import java.awt. *;
import java.awt.event.*;
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new GridBagLayout());
textINR.setFont(font);
textUSD.setFont(font);
btnToUSD.setForeground(Color.WHITE);
btnToUSD.setFont(font);
btnToINR.setForeground(Color.WHITE);
btnToINR.setFont(font);
btnClose.setForeground(Color.WHITE);
btnClose.setFont(font);
btnToUSD.addActionListener(e -> {
String input = textINR.getText().trim ();
if (input.isEmpty() || !input.matches("\\d+(\\.\\d+)?")) {
return;
if (amountINR < 0) {
return;
textUSD.setText(String.format("%.2f", amountUSD));
});
btnToINR.addActionListener(e -> {
if (input.isEmpty() || !input.matches("\\d+(\\.\\d+)?")) {
return;
if (amountUSD < 0) {
JOptionPane.showMessageDialog(frame, "Please enter a positive number for
USD.");
return;
textINR.setText(String.format("%.2f", amountINR));
});
frame.pack();
frame.setVisible(true);
SwingUtilities.invokeLater(CurrencyConverter :: converter);
}
}
RAM: 8 GB
a. Practical Outcomes
a. Write a java program to demonstrate AWT components.
b. Write a java program to handle KeyEvent.
c. Write a java program to demonstrate ActionEvent.
a. Practical Outcomes
d. Write a java program to demonstrate AWT components.
e. Write a java program to handle KeyEvent.
f. Write a java program to demonstrate ActionEvent.
a. Practical Outcomes
g. Write a java program to demonstrate AWT components.
h. Write a java program to handle KeyEvent.
i. Write a java program to demonstrate ActionEvent.
a. Practical Outcomes
j. Write a java program to demonstrate AWT components.
k. Write a java program to handle KeyEvent.
l. Write a java program to demonstrate ActionEvent.