Ajp Final MP

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

8 PART A – Micro-Project Proposal

Introduction
Swing is a powerful GUI toolkit in Java that allows developers to create rich user
interfaces for desktop applications. One common requirement in network-related
applications is to capture or validate an IP address from the user. Swing provides
various components like JText Field, JPanel and J Label hat can be combined to
create an interface where users can input an IP address.
In this task, we will design a simple Java Swing-based interface that allows users
to input an IP address. The program will include:
 Text fields to enter each part (octet) of the IP address.
 Validation logic to ensure the input follows the standard IPv4 format (four
octets separated by dots, with each octet ranging from 0 to 255).
This type of interface is useful for applications like network configuration tools,
where the user needs to provide a valid IP address to connect to a server or
device.
Let’s explore how to implement this using Swing components like JTextField J
jPanel jLabel and possibly a for submission.
ACKNOWLEDGEMENT

We would like to express our thanks to the people who have helped us most
throughout our project. We would like to express our sincere thanks to the
principal of CSMSS College of Polytechnic Prof. Ganesh B. Dongre for being
always with us as a motivator. We are thankful to the H.O.D. of Applied
Science Department Mr. Shivam Mr Sandeep Mr. Rushikesh for her kind
support. We are grateful to our Project Guide MR. S. L. Ushalwar for nonstop
support and continuous motivation for the project. His help made us possible to
complete our project with accurate information. A special thanks of our goes to
our friends who helped us in completing the project, where they all exchanged
their own interesting ideas. We wish to thanks our parents for their personal
support or attention who inspired us to go our own way. Finally, we would like
to thank God who made all things possible for us till the end.

Sr. No. Name of Student Sign


1 SHIVAM SHANKER SINGH

2 SANDEEP PRADHAN

3 RUSHIKESH MALAINI

••••••••••••••••••••••••••••••••• INDEX ••••• ••• ••• ••• ••• ••• ••• ••• ••• •.
1. MICRO - PROJECT PROPOSAL ……… ………… ……… …… 1 - 3

2. RATIONALE ……………… …………… ………………………. 4

4
3. AIMS / BENEFITS OF THE MICRO - PROJECT………………

4. COURSE OUTCOMES ACHIEVED ……………………………

5. LITERATURE REVIEW…………………………………………5 - 14

4. ACTUAL RESOURCES USED ………………………………….

5. ACTUAL METHODOLOGY FOLLOWED ………………… 15 - 17

6. OUTCOMES OF THE MICRO - PROJECT ………………….17 - 19 9.


SKILL DEVELOPED / LEARNING OUTCOMES
OF MICRO-PROJECT…… …………… ………… ……… ……. 20

10. APPLICATIONS OF MICRO - PROJECT ……………...………. 20

MICRO - PROJECT PROPOSAL


TITLE : PREPARE A IPADDRESS USING SWING

1.0 AIMS /BENEFITS OF THE MICRO PROJECT –

TO PERFORM to retrive ip using Swing API

2.0 COURSE OUTCOMES ADDRESSED -

1. INTERPRET THE BASIC CODE OF “ ”


2. IMPLEMENT SWING API IN JAVA

3. USING API SWING JFRAME and other COMPONEBT


JAVA

3.0 PROPOSED METHODOLOGY :


1. BASIC INFORMATION ABOUT JAVA .

3. USE SOME OF COMPONET AND JAVA IDE TO BUILD A BASIC JAVA IPADDRESS
4.0 ACTION PLANE

Sr. Details of Activities Planned Planned Name of Name of Responsible


No. Start Date Finish Responsible

Date Team
1 Study JAVA 29/07/2024 03/08/2024 Member ALTAMASH SHAIKH
All
2 Study SWING 05/08/2024 10/08/2024 All
SIDDIQ SHAIKH
3 Study COMPONENT 12/08/2024 17/08/2024 All
TELI ARMAN

4 19/08/2024 24/08/2024 All


Select Relevant Topic for FAHIM SHAIKH
Micro- Project .
5 Perform JAVA 02/09/2024 07/09/2024 All MOHAMMAD SAAD
PROGRAM for Micro-
Project .
6 09/09/2024 14/09/2024 All SIDDIQ SHAILH
Make Project Report for
Micro- Project.

Resources Required
Sr.N Name of Resource / Spe Quantity Remarks
o. Material cifications

1 Computer RAM minimum 8GB, 1


I7 9TH GEN
2 Operating System Windows 10 1 .
PART B: MICRO-PROJECT REPORT

TITLE : PREPARE A JAVA PROGRAM TO GET IP ADDRESS

1.0 RATIONALE :
The idea of this micro-project is to make a We can develop IP Finder in java with the
help of Networking AWT/Swing with event handling. Let's see the code of creating
IP Finder in java.

2.0 AIMS / BENEFITS OF THE MICRO PROJECT :

To Perform Basic IP FINDING using java.


To Find ip address and can also easily rrack on site
Can be use to moniter the ip address

3.0 COURSE OUTCOMES ACHIEVED :

1) Interpret The Basic Code Of “JAVA ".


2) Task Remainder Making In "JAVA " Programming .
3) Use Functions In "Java" Programs For Building a basic frame




4.0 LITERATURE REVIEW :

❖ History of "JAVA" Language programing

Java is a class-based, object-oriented programming language that is


designed to have as few implementation dependencies as possible. It is a
general-purpose programming language intended to let application
developers write once, run anywhere (WORA) meaning that compiled
Java code can run on all platforms that support Java without the need for
recompilation [ Java applications are typically compiled to bytecode that
can run on any Java virtual machine (JVM) regardless of the underlying
computer architecture. The syntax of Java is similar to C and C++, but
has fewer low-level facilities than either of them. The Java runtime
provides dynamic capabilities (such as reflection and runtime code
modification) that are typically not available in traditional compiled
languages. As of 2019, Java was one of the most popular programming
languages in use according to GitHub, particularly for client-server web
applications, with a reported 9 million developers.
Java was originally developed by James Gosling at Sun Microsystems (which has
since been acquired by Oracle) and released in 1995 as a core component of Sun
Microsystems' Java platform. The original and reference implementation Java
compilers, virtual machines, and class libraries were originally released by Sun
under proprietary licenses. As of May 2007, in compliance with the
specifications of the Java Community Process, Sun had relicensed most of its
Java technologies under the GNU General Public License. Oracle offers its own
Hot Spot Java Virtual Machine, however the official reference implementation is
the OpenJDK JVM which is free open source software and used by most
developers and is the default JVM for almost all Linux distributions.

Java 15 General Availability occur red on September 15. 2020. with Java 16 now
in Rame down Phase Two (Initial Release Candidate expected February 4, 2021),
and with Java 17 now also in

public class IPFinder extends JFrame, implements ActionListener{

❖ Basic About JAVA:


The Java language has undergone several changes since JDK 1.0 as well as
numerous additions of classes and packages to the standard library. Since
J2SE 1.4, the evolution of the Java language has been governed by the Java
Community Process (JCP), which uses Java Specification Requests (JSRs) to
propose and specify additions and changes to the Java platform. The
language is specified by the Java Language Specification (JLS); changes to the
JLS are managed under JSR 901.

In addition to the language changes, other changes have been made to the
Java Class Library over the years, which has grown from a few hundred
classes in JDK 1.0 to over three thousand in J2SE
5. Entire new APIs, such as Swing and Java2D, have been introduced, and
many of the original JDK 1.0 classes and methods have been deprecated.
Some programs allow conversion of Java programs from one version of the
Java platform to an older one (for example Java 5.0 backported to 1.4) (see
Java backporting tools).
Regarding to Oracle Java distribution, version 11 is the currently supported

long-term support (LTS) version (and Java 8 LTS to some degree). ("Oracle

Customers will receive Oracle Premier Support"); Oracle released for the

"legacy" Java 8 LTS the last free software "public update" in January 2019 for

commercial use, while Oracle continues to release no-cost public updates for

Java 8 for e.g. development and personal use indefinitely. Java 10 is the

previously supported rapid release version. Java 10 support ended on the same

date that support for Java 11 began, in September 2018. Java 7 is no longer

publicly supported, and Java 9 has stopped receiving updates since Java 9 was a

short-term rapid release version that has been superseded by Java 10 and now

Java 11. For Java 11, long-term support will not be provided by Oracle for the

public; instead, the broader

Actuall Coding :-

package project; import

javax.swing.*; import

java.awt.event.*;

import java.net.*;

JLabel l;

JTextField tf;

JButton b; IPFinder()

{ super("IP Finder Tool -


Javatpoint"); l=new JLabel("Enter

URL:");

l.setBounds(50,70,150,20);;

tf=new JTextField();

tf.setBounds(50,100,200,20);

b=new JButton("Find IP");

b.setBounds(50,150,80,30);

b.addActionListener(this);

add(l); add(tf);

add(b);

setSize(300,300);

setLayout(null);

setVisible(true);

public void actionPerformed(ActionEvent e){

InetAddress ia=InetAddress.getByName(url);

String ip=ia.getHostAddress();

Joption Pane.showMessageDialog(this,ip);

} catch (UnknownHostException e1) {

JOptionPane.showMessageDialog(this,e1.toString());

String url=tf.getText();

try {
}

} public static void main(String[]

args) { new IPFinder();

OUTPUT OF CODE:-

IP FINDING Frame which take and input for web site in the fromat for
www.domainname.co m so it will return a IP address of that website it can be use for ip
tracking device

Example -:this iswww.GOOGLE.co


m IP address
8.0
SKILL DEVELOPED / LEARNING OUTCOMES OF MICRO -
PROJECT

1. and domanin name and ip Learn Basic of the Java Programming


language
2. Use Various Componet for swing from java.

3. Learn Basic networking address

9.0 APPLICATIONS OF MICRO - PROJECT :

● Applications of IP Finder:
1. Network Configuration Tools
 Use Case: Software that configures network devices (such as routers,
switches, or servers) often requires the user to input an IP address to
connect or modify the device's settings.
 Application: The IP address input interface can be used to allow users to
enter the IP addresses of devices they want to configure or manage in a
local or remote network.
2. Client-Server Applications
 Use Case: In client-server models, clients need to connect to a server using
its IP address. For example, a file transfer application or chat application
may require users to input the server's IP.
 Application: The GUI can be implemented to capture the server's IP
address and establish the connection, validating it before proceeding to
avoid connection failures.
3. Network Diagnostics Tools
 Use Case: Tools like ping testers, port scanners, or trace-route applications
often need the user to provide an IP address to perform diagnostics on
network health or connectivity.
 Application: The IP input GUI can serve as the starting point for network
diagnostic utilities, enabling users to enter the IP address they want to
diagnose and ensuring it is a valid IPv4 address.
4. IP-based Access Control
 Use Case: Systems that grant or restrict access to certain network services
based on IP addresses (e.g., firewalls or web server access control lists)
need users to input the correct IP address ranges.
 Application: This Swing-based interface can be part of an admin tool
where users input IP addresses to configure access control policies,
ensuring that the IP format is validated before submission.

Intended Course Outcomes

1. Understand the Basics of GUI Development with Java Swing

 Outcome: Students will be able to create simple graphical user interfaces


using Swing components, such as JFrame JPanel, JTextField JLabel, and
JButton

 Skills Gained: Familiarity with Java Swing libraries and components,


understanding layout management for organizing components in a
window.

2. Design and Implement Input Forms for User Data


 Outcome: Students will be able to design input forms for collecting user
data, specifically for capturing and validating IP addresses.

 Skills Gained: Ability to create forms with text fields, handle input data,
and ensure correct formatting of the data provided by the user.

3. Implement Data Validation Techniques

 Outcome: Students will be able to implement logic that validates user


inputs, ensuring that data (such as IP addresses) conforms to specific rules
(e.g., four octets ranging from 0 to 255).

 Skills Gained: Experience with input validation techniques, exception


handling (such as Number Format Exception), and error feedback
mechanisms for invalid data.

4. Apply Event-Driven Programming in Java

 Outcome: Students will gain experience in event-driven programming,


responding to user actions such as button clicks to trigger input validation
and form submission.

 Skills Gained: Understanding how to use ActionListener in Java to manage


user events, improving interactivity in GUI applicati
Algorithem

Step 1: Initialize the Swing Framework

1. Start the main method: Create the main class for your application that extends JFrame
to create a window for the user interface.

2. Set up the JFrame: Initialize the JFrame with a title, close operation, size, and layout
manager (e.g., FlowLayout).

Step 2: Create Swing Components

1. Create JLabel for User Instruction: Add a JLabel that instructs the user to input the IP
address.

2. Create JTextField for IP Input: Add a JTextField where the user can input the IP
address. Set an appropriate width (e.g., 15-20 columns).

3. Create JButton for Submission: Add a JButton labeled "Submit" that allows the user to
submit the input.

Step 3: Add Components to the Frame


1. Add Components to the Layout: Use the layout manager to add the JLabel, JTextField,
and JButton to the JFrame.

Step 4: Implement Event Handling

1. Set ActionListener for JButton: Attach an ActionListener to the button so that clicking
it triggers the IP address validation logic.

Proposed Methodology:

Step 1: Define Project Objectives

 Create a graphical user interface (GUI) that allows users to input an IP address.

 Validate the input to ensure it is a properly formatted IPv4 address.

 Provide feedback to users on whether the IP address is valid or not.

Step 2: Design the User Interface

JFrame Setup

o The main window of the application (JFrame) will contain components for the
user to interact with. The JFrame will have:

 A label to prompt the user for input.

 A text field (JTextField) to accept the IP address.


 A button (JButton) for submission.

 Optionally, additional labels or dialog boxes for error messages or


validation feedbac

Add Swing Components

 JLabel: Used to prompt the user to enter the IP address.

 JTextField: A text field where users can input the IP address.

 JButton: A button for users to click after entering the IP address.

 JOptionPane: Optional for displaying feedback to the user after submission

3.Layout Management:

 Use Flow Layout, Grid Layout, or Box Layout for arranging


components within the jframe Step 3: Implement IP Valida

Step 3: Implement IP Validation Logic

1. Action Listener:
o Attach an ActionListener to the "Submit" button that triggers
IP address validation when clicked.
2. IP Address Validation:
o When the button is clicked, retrieve the user input from the
JTextField using get get Text()
o Validate the format of the IP address by:
 Splitting the input by the "." (dot) delimiter.
 Checking that the result contains exactly 4 parts (for IPv4
addresses).
 Ensuring that each part is a number between 0 and 255.
3. Error Handling:
o If the IP address is invalid (e.g., incorrect format or out-of-range
values), display an error message to the user using JOptionPane
show Message Dialog.
o If the IP is valid, display a success message or perform additional
tasks like resolving the IP address using Inet Address.

Conclusion

In this project, we developed a Java Swing application to validate IP addresses


efficiently. This application provides a straightforward interface for users to input
an IP address and receive immediate feedback on its validity.

Key Features:

 User Interface: The application consists of a simple GUI built with JFrame,
JTextField, JButton, and JLabel, ensuring an intuitive user experience.

 Validation Logic: It utilizes the InetAddress.getByName() method to check


if the entered IP address is valid, supporting both IPv4 and IPv6 formats.

 Immediate Feedback: The application gives real-time validation results,


displaying messages in green for valid IPs and red for invalid ones,
enhancing clarity.

Summary of Implementation:
1. Initialize the JFrame: Set up the main application window.

2. Add Components: Include necessary GUI elements for user interaction.

3. Handle User Input: Implement an action listener for the button to trigger
the validation process.

4. Run the Application: Users can compile and execute the program to
validate their IP addresses interactively.

This Swing application not only serves as a practical tool for validating IP
addresses but also demonstrates fundamental concepts of GUI programming in
Java. The structure of the code

REFERENCES

You might also like