Ajp Final MP
Ajp Final MP
Ajp Final MP
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.
2 SANDEEP PRADHAN
3 RUSHIKESH MALAINI
••••••••••••••••••••••••••••••••• INDEX ••••• ••• ••• ••• ••• ••• ••• ••• ••• •.
1. MICRO - PROJECT PROPOSAL ……… ………… ……… …… 1 - 3
4
3. AIMS / BENEFITS OF THE MICRO - PROJECT………………
5. LITERATURE REVIEW…………………………………………5 - 14
3. USE SOME OF COMPONET AND JAVA IDE TO BUILD A BASIC JAVA IPADDRESS
4.0 ACTION PLANE
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
Resources Required
Sr.N Name of Resource / Spe Quantity Remarks
o. Material cifications
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.
•
•
•
4.0 LITERATURE REVIEW :
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
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
Actuall Coding :-
javax.swing.*; import
java.awt.event.*;
import java.net.*;
JLabel l;
JTextField tf;
JButton b; IPFinder()
URL:");
l.setBounds(50,70,150,20);;
tf=new JTextField();
tf.setBounds(50,100,200,20);
b.setBounds(50,150,80,30);
b.addActionListener(this);
add(l); add(tf);
add(b);
setSize(300,300);
setLayout(null);
setVisible(true);
InetAddress ia=InetAddress.getByName(url);
String ip=ia.getHostAddress();
Joption Pane.showMessageDialog(this,ip);
JOptionPane.showMessageDialog(this,e1.toString());
String url=tf.getText();
try {
}
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
● 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.
Skills Gained: Ability to create forms with text fields, handle input data,
and ensure correct formatting of the data provided by the user.
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).
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.
1. Set ActionListener for JButton: Attach an ActionListener to the button so that clicking
it triggers the IP address validation logic.
Proposed Methodology:
Create a graphical user interface (GUI) that allows users to input an IP address.
JFrame Setup
o The main window of the application (JFrame) will contain components for the
user to interact with. The JFrame will have:
3.Layout Management:
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
Key Features:
User Interface: The application consists of a simple GUI built with JFrame,
JTextField, JButton, and JLabel, ensuring an intuitive user experience.
Summary of Implementation:
1. Initialize the JFrame: Set up the main application window.
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