0% found this document useful (0 votes)
5 views

JAVA PAD

The document outlines the development of JAVA PAD, a user-friendly interface for writing and reading Java programs, which integrates various tools from the Java Development Kit (JDK) to simplify the coding process. It addresses the limitations of existing systems by providing a more accessible environment for beginners, including features like shortcut keys, a built-in calculator, and string manipulation tools. The document also discusses the feasibility study, system requirements, and design aspects of the JAVA PAD project.

Uploaded by

mrpctechnologies
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

JAVA PAD

The document outlines the development of JAVA PAD, a user-friendly interface for writing and reading Java programs, which integrates various tools from the Java Development Kit (JDK) to simplify the coding process. It addresses the limitations of existing systems by providing a more accessible environment for beginners, including features like shortcut keys, a built-in calculator, and string manipulation tools. The document also discusses the feasibility study, system requirements, and design aspects of the JAVA PAD project.

Uploaded by

mrpctechnologies
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 73

1

1
Chapter

Introduction
1.1 OBJECTIVE

JAVA PAD
2

This project deals with the user interface, that is to write and read the
java program using some external functions. The aim of the project is, the
user can write the java program, the shortcut key will be call to generate the
some coding the user to call the java pre-defined class. We have written the
commands in the DOS- PROMPT, but we can create the menu to view the
java pre-defined classes, constructor and fields.

The users’ implements some interface in the java program the user to
mention the interface the editor that functions will be generated in to the java
program. The users to calculate some manual calculation we have to use
calculator. We can remove the problem so we have to call the calculator
with the help of some classes in the java language.

The users any doubt in the java keywords and control statements, they
can view using the tools menu function. The users can write any text
information and t manipulate some string operations like find & replace and
to select the particular string is to converted into upper or lower case.

1.2 PROBLEM OVERVIEW.

The major disadvantage of using java is we need a special editor to


write a java program and it’s a java runtime environment to run a program.
It’s difficult to some beginners to download the java developer kid
accurately if they miss some of the header files while downloading the JDK
it will create some bad situation to them and there will be a loss of time.

JAVA PAD
3

To avoid this we have created JAVA PAD which helps the user to
save file and they can do all the functions that as in JDK. JAVA PAD comes
with a collection of tools that are in JDK like appletviewer, javac, java
interpreter, javap, javah, javadoc, jdb etc,.

1.3 BRIEF DESCRITION

JAVA PAD includes a large number of development tools and


thousands of classes and methods. That is equals to API. Here we can easily
write our coding and we can compile and run our application in the same
window as in Visual Basic.

JAVA PAD is like a platform where we can find java’s own icons
and keys which can be used in our programs. In JAVA PAD we can write
coding for ordinary programming command, where we can do some
complex programs also.

Next we can write applet programs, like any application program, can
do many thinks for us. It can perform arithmetic operation, displays
graphics, play sounds, accept user input, create animation and play
interactive games. Here we don’t want Applet Viewer or any Web
Browsers.

Next we can create swing programs such that we can create option
button, button, tree, tabbed text field etc.,

JAVA PAD

2
4

Chapter

LiteratureRevie
w
JAVA PAD
5

2.1 EXISTING SYSTEM

Before designing the project, all the activities of the java editor was
performed manually. User saw the java pre-defined class with the help of
DOS-PROMPT. User Compile and run the program through DOS-
PROMPT only. There is no shortcut key for keywords.

2.1.1 Limitations of Existing System


 Debugging is difficult.
 Time consume is high.
 Compile and Run only through Dos-Prompt

2.2 PROPOSED SYSTEM

This project actually has different menus .with these menus the different
activities of the “Java Pad” has been done. The menus are as follows, by
using these menus we can run on this project very easily

JAVA PAD
6

3
Chapt
er

System
Analysis
And
JAVA PAD
7

Requirements

3.1 Requirement Analysis and Design Reports

Analysis Design Code Test


.

3.1.1 Analysis model

Linear Sequential Model:

Linear Sequential Model was used for the development of this project
as this model is the easiest to implement for small project of short duration.
Linear Sequential Model is also known as classic life cycle or waterfall
model. This model suggests a systematic, sequential approach. The Linear
Sequential Model encompasses the following activities.

a. System / Information Engineering:

JAVA PAD
8

System / Information Engineering is concerned with the


interaction that’s software will face with other elements likes hardware,
people and databases.
System Engineering encompasses required gathering at the
system level with the small amount of top-level design and analysis.
Information Engineering encompasses required gathering at strategic
business area level.

b. Analysis:
It is concerned with how the software is analyzed for its
successful developments. It includes finding which out operating system,
database and the front end software will best suit for the software to work
according to our requirements.
c. Design:

It is concerned with the design of the software both the input and
output. The input screen should be designed in such a way that it is user
friendly. The output screen should be designed in such a way that desired
output should be presented in an attractive manner.

3.2 Feasibility Study

It is necessary to determine whether the proposed system is feasible or


not. Every project is feasible if given unlimited resource and infinite time.
Unfortunately the development of a computer-based system is more likely to
be plagued by scarcity of resources and difficult delivery of data. It is both

JAVA PAD
9

necessary and prudent to evaluate the feasibility of the project at the earliest
time possible. Precious time and money can be saved and untold
professional embarrassment can be averted if an ill-conceived system is
recognized early in the definition phase. So a detailed study is carried out to
check the workability of the system.
Feasibility study is undertaken to evaluate its workability, impact on
the organization, ability to meet user needs, and effective use of resources.
The main objective of feasibility study is to test the technical, operational
and economical feasibility of developing the computer system. Thus, during
feasibility analysis for this project the following three primary areas of
interest were considered.

 Technical Feasibility
 Economical Feasibility
 Operational Feasibility

3.2.1 Technical Feasibility


A study of resource availability may affect the availability to achieve
and acceptable system. The technical feasibility is frequently the most
difficult area to ensure at this stage. Because objective, functions and
performance are somewhat hazy, anything seems possible if the right
assumptions are made. It is essential that the process of analysis and
definitions be conducted in parallel with an assessment of technical
feasibility.
The technical issues are usually raised during the feasibility stage of
the investigation, including the following.

JAVA PAD
10

 Does the necessary technology exist to do what is suggested?


 Will the proposed system provide adequate response to enquires,
regardless of the number of location of users?
 Can the system be expanded if developed?
 Does this technique guarantee accuracy, reliability, easy of access and
data security?

The consideration that is normally associated with technical feasibility


includes resources availability of the organization, where the project is to be
developed and implemented. By taking these factors into consideration
before developing, the resources available are adequate. Thus the project is
considered technically feasible for development.

3.2.2 Economic Feasibility


A system that can be developed technically and that will be used, if
installed, must still be a good investment for the organization. Economic
feasibility deals with evaluation of development cost weighted against the
ultimate income or benefit derived from the developed system. Financial
benefits must equal or exceed the costs. The financial and economic
questions raised by analysts during the preliminary investigation are for the
purpose of estimating the following.

 The cost of conducting a full system investigation.


 The cost of hardware and software for the application being
considered.
 The benefits in the form of reduced cost or fewer costly errors.

JAVA PAD
11

Economical justification is generally the bottom line consideration for


most systems. Economical justification includes a board range of concerns
that include cost benefit analysis. Cost benefit analysis delineates costs for
project development and weights them against tangible and intangible
benefits of a system.

3.2.3 Operational Feasibility


Proposed project are beneficial only if they can be turned into
information system that will meet the organizations operating requirements.
Operational feasibility is a consideration about the working of the system
after installation in the company. Simply stated, this system of feasibility
asks if the system will work when it is developed and installed.
The following are the questions that help the operational feasibility of
the project
 Is there sufficient support for the project from management and users?
 Have the users been involved in planning and development of the
project?
 Will the proposed system cause harm?
 Will it produce poor results in any respect or area?
 Will accessibility of information be lost?

3. 3 SPECFICATION

A complete understanding of requirement is essential to the


success of software development effort irrespective of coding. Requirements

JAVA PAD
12

analysis is a software engineering task. Which bridges the gap between the
computer system engineer and software design?

SYSTEM REQUIREMENTS

HARDWARE REQUIREMENTS

The configuration of the developed system is as follows

PROCESSOR : Pentium IV 3.5GHz


RAM : 512GB
DISKDRIVE : 80GB
FLOPPY : 1.44MB
COMPACT DISK DRIVE : 700MB

KEYBOARD : Multimedia
MONITOR : 17 Samsung
MOUSE : Logitech

SOFTWARE SPECIFICATION

PLATFORM : Windows XP
FRONT END : Java 2.0

JAVA PAD
13

4
Chapter

JAVA PAD
14

System Design
ActionListener
WindowListener
MouseListener
ComponentListener
KeyListener
Frame TextListener

4.1 UML DIAGRAM

Class Pad

Members
File, Edit, Search, Help, Tools. : Menu
New1, open, save, save as, close, exit. : Menu Item
Undo, cut, copy, paste, select all, time. : Menu Item
Find, fnext, find replace :MenuItem
Compile, run, interface, java lib, keyword :MenuItem
Calculator :MenuItem
Keyword shortcuts :MenuItem
About, about us :MenuItem

Methods

+Pad()
+Void paint (graphics)
+actinPerformed(ActionEvent)
+keyPressed(KeyEvent)
+KeyTyped(KeyEvent)
+KeyReleased(KeyEvent)
+componentResized(ComponentEvent)
+mouseClicked(MouseEvent)
+mousePressed(MouseEvent)
+mouseReleased(MouseEvent)
+mouseEntered(MouseEvent)
+mouseExited(MouseEvent) JAVA PAD
+windowOpend(WindowEvent)
15

+windowClosing(WindowEvent)
+windowIconified(WindowEvent)
+windowDeiconified(WindowEvent)
+windowActivated(WindowEvent)
+windowDeactivated(WindowEvent)
+textValueChanged(TextEvent)
+ComponentMoved(ComponentEvent)
+ComponentShown(ComponentEvent)
+void componentHidden(ComponentEvent)
+void exitFile()
+openFIle()
+saveFile()
+saveasFile()
+cutString()
+pasteString()
+deleteString()
+gTime()
+calcul()

JAVA PAD
16

4.2 USE CASE DIAGRAM Compile

Compression
&
Decompression
Run

View java
API
user JAVA PAD

Add
Interface

View
Keywords
and Control
stmt

String
Functions

JAVA PAD
Key word
Shortcuts
17

5
Chapter

Software
JAVA PAD
18

Description

5.1 Windows Operating System


With the Windows 2000 Server operating system, Microsoft has
accomplished a goal rarely achieved in the software industry: delivered a
product that is evolutionary and revolutionary at the same time. Evolutionary
in that Windows 2000 builds on the great things about the Windows NT
Server 4.0 operating system.
Revolutionary in that Windows 2000 Server sets a new standard for
how well an operating system can be integrated with Web, application,
networking, communication, and infrastructure services. Windows 2000
Advanced Server operating system provides all of the features and benefits
of Windows 2000 Server.
With Windows NT, a software development platform, which is used
by programmer’s to develop complex scientific and business application. It
includes security and Networking services as fundamental components of
the operating system.

5.2 JAVA

JAVA PAD
19

JAVA is an object oriented language, it is basically supports all


concepts of c and c++ with some additional features. Other attractive feature
JAVA is a platform independent language. The genesis of java is complete
without a look at the java buzzwords.
 simple
 secure
 portable
 object-oriented
 robust
 multithreaded
 architecture-neutral
 interpreted
 high performance
 distributed
 dynamic

Java can be used to create two types of programs: applications and


applets. An application is a program that runs on your computer under the
operating system of your computer. An applet is a application designed to
transmitted over the internet and executed by the java compatible web
server.
An applet is a tiny java program, dynamically downloaded across the
network, just like an image, sound file or video clip. The important
difference is that an applet is an intelligent program, not just an animation or
media file.

JAVA PAD
20

5.2.1 Dynamic Link Library

Dynamic link Library is the file extension. It is a block of code


containing. Procedures and functions those are useful for more than one
program. Linking is nothing but getting the prewritten code in our program.
The linking is done in two ways
1. Static Linking
2. Dynamic Linking

Dynamic Linking
In dynamic linking, the external library file never gets bound in to the
final executable file. It remains outside the program as DLL, hopefully in a
place.
Where the executable can find it ant it messages. At run time, these
messages are function or procedures calls, requesting that certain parts of the
DLL code are executed.
To link your executable and the DLL it needs to run, just take the
program Where the DLL is, and which bit of code we want run from inside
it. it is ,as we say, dynamically linked.
Advantages of dynamic linking are 1.consistency, 2.Maintenance,
3. Smaller Executables
 Consistency gives more or less common user interface across
application.
 By having a lot of common code in one place, you can update
and amend that code centrally, and changes are reflected all the
JAVA PAD
21

applications that use it. That’s why, when you run windows 3.1
applications on Windows 95. They inherit some user interface
features of the new system.
 By moving a lot of the back room business out of another file
rather than statically linking the functions and procedures, we
can reduce size of your executable.
5.2.2 The Windows API
The windows application programmers interface is a collection of
ready-made function and procedures. Most of the API calls are already
implemented in JAVA, run the forms of JAVA commands, keywords,
methods and properties.thease are translated into the corresponding API
calls inside the JAVA.

5.2.3 JAVA PACKAGES AND API

AWT
The AWT classes contained by the java.awt package. It is one of
the largest packages. Because it is logically organized in a top-down,
hierarchical fashion, it is easier to understand and use than you might at first
believe.AWT contains numerous classes and methods that allow you to
create and manage windows. It also explains further aspects of java’s event
handling mechanism. The main purpose of the AWT is to support applet
windows, it can be used to create stand –alone windows that run in a GUI
environment such as windows.

a. APPLET
The applet class is contained by the java.applet package. Applet

JAVA PAD
22

Contains several methods that give you detailed control over the execution
of your applet. Java.applet also defines three interfaces AppletContext,
AudioClip, AppletStub. All applets must import with java. applet .applets
must also import with the java.awt.

b. UTIL
The java.util package contains some of the most
exitingenhancements added by java 2 collections .a collections is group of
objects the addition of collections caused fundamental alterations in the
structure and architecture of many elements of java.util.java.util contains a
wide range of functionality.thease classes and interfaces are used throughout
core java packages. These include classes that tokenize the string, work with
dates, compute random numbers and observe events.

c. NET
The java.net package which provides support of networking. Java is
good language for networking the classes are defined in java.net package.
These networking classes encapsulate the “socket” paradigm pioneered by
the BSD.

d. ZIP
The java.util.zip package provides the ability to read and write files
in the popular ZIP and GZIP formats. Both ZIP and GZIP input and output
streams are available. Other classes implement the ZLIB algorithms for
compression and decompression.

JAVA PAD
23

e. SWING
The swing is a set of classes that provides more powerful and flexible
components than are possible with the AWT. Unlike AWT components
Swing components are not implemented by platform specific code. They are
written entirely in java and, therefore, are platform-independent.
The term lightweight is used to describe such elements. The number
of classes and interfaces in the swing packages is substantial. Swing is area
that you will want to explore further on your own

5.2.4 APPLICATION PROGRAMMING INTERFACES

Listeners are created by implementing one or more of the interfaces


Defined by the java.awt.event package. When an event occurs, the event
Source invokes the appropriate method defined by the listener.

Action Listener interface

This interface defines the actionPerformed () method that is Invoked


when an action event occurs. Its general form is shown
Void actionPerformed (ActionEvent ae)
The mouselistener interface
Void windowActivated(WindowEvent we)
Void windowActivated(WindowEvent we)

This interface defines five methods.If the mouse is pressed and


released at the same point,mouseClicked() is invoked.Whenthe mouse enters
JAVA PAD
24

a component,the mouseEntered() method is called.When it leaves,


mouseExited() is called. The mousePressed andmouseRealeased() methods
are invoked when the mouse is pressed andreleased, respectively. The
general forms of these methods are shown here:
Void mouseClicked(MouseEvent me)
Void mouseEntered(MouseEvent me)
Void mouseExited(MouseEvent me)
Void mousePressed(MouseEvent me)
Void mouseRealeased(MouseEvent me)

b.The MouseMotionListener interface


This interface defines two methods. The mouseDragged() method is
called multiple times as the mouse is dragged. The mouseMoved() method
multiple times as the mouse is moved. Their general forms are shown here:
Void mouseDraged(MouseEvent me)
Void mouseMoved(MouseEvent me)

c.The TextListener interface


This interface defines the textChanged() method that is invoked when
a change occurs in a text area or text field. Its general form is shown here:
Void textChanged(TextEvent te)

d.The WindowListener interface


This interface defines seven methods. The windowActivated() and
windowDeactivated() methods are invoked when a window is activated or
deactivated, respectively. If a window is iconified, the windowIconifed()
method is called. When a window is deiconified, the windowDeiconified()
JAVA PAD
25

method is called. When a window is opened or closed, the windowOpened()


or windowClosed() methods are called, respectively. The windowClosing()
method is called when a window is being closed. The general forms of these
methods are
Void windowActivated(WindowEvent we)
Void windowClosed(WindowEvent we)
Void windowClosing(WindowEvent we)
Void windowDeactivated(WindowEvent we)
Void windowDeiconified(WindowEvent we)
Void windowIconified(WindowEvent we)
Void windowOpened(WindowEvent we)

5.2.5 Using the delegation event model


Now that you have learned the theory behind the delegation event
model and have had an over view of its various components, it is time to see
it in practice.appletprogramming using the delegation event model is
actually Quite easy. Just follow these two steps:

1. Implement the appropriate interface in the listener so that it will


receive the type of event desired.
2. Implement code to register and unregister(if necessary)the listener
as a recipient for the event notifications.
Remember that a source may generate several types of events. Each
event must be registered separately also, an object may register to receive
several types of events, but it must implement all of the interfaces that are
required to receive these events.
To see how the delegation model works in practice, we will look at
JAVA PAD
26

examples that handle the two most commonly used event generators: the
mouse and keyboard.

5.3 Applet
Applet provides all necessary support for execution, such as starting
And stoping.it also provides methods that load and display images and
methods that load and play audio clips.
Applet extends the AWT class panel. In turn panel extends container,
which extends component. These classes provide support java’s window
based, graphical interface. Thus applet provides all of the necessary support
for window-based activities image
This class provides support foe imaging. Images are objects of the
Image class, which is a part of the java.awt package. There is a large
number of imaging classes and interfaces defined by java. awt. image and its
not possible to examine them all.
Event.
The classes that represent events are at the core of java’s events
handling mechanisms. They provide a consistent, easy-to-use means of
encapsulating events. At the root of the java event class hierarchy is
EventObject, which is in java.util. It is the super class for all events. Its one
constructor is shown
EventObject(Object src)

JAVA PAD
27

6
Chapter

JAVA PAD
28

Data Flow

Diagram

TEXT EDITOR

JAVA SOURCE CODE JAVADOC HTML FILES

JAVAC

JAVA
JAVA CLASS FILE
PAD JAVAH HEADER

JAVA JDB
JAVA PAD

JAVA PROGRAM
OUTPUT
29

6. Data flow diagram

7
JAVA PAD
30

Chapter

Testing

TESTING

This is the most important phase in software development. In this


phase the programmer checks for any possible errors in his software after

JAVA PAD
31

development. Less the errors are the better is the software. It decides the
robustness of the software that is done by giving it all types of data and
checking if it works perfectly.

7.1 TESTING FUNDAMENTALS


VALIDATION TESTING

Validation can be defined in many ways. But the simple


definition is that validation succeeds when software functions in manners
that can be reasonably expected by the customer. The software specification
contains a section called Validation Criteria. Information contained in that
section forms the basics for validation testing approach.

 VALIDATION TEST CRITERIA


Software validation in achieved through series of black-
box tests that demonstrate conformity with requirements.
After each validation test case has been conducted one of
two possible conditions exists.
i. The function (or) performance characteristics conform to
specification and are accepted.
ii. A deviation from specification is uncovered and a
deficiency list is created.

 ELEMENTS OF VALIDATION TESTING

JAVA PAD
32

i. Configuration Review
To ensure that all the elements of the software
configuration have been properly developed and
cataloged.
ii. Alpha Testing
Conducted at the developer’s site by a customer in
a controlled environment to enable the customer to
validate all requirements.
iii. Beta Testing
It is conducted at one or more customer sites by
the end-user of the software without developer’s
control. The problems encountered during beta
testing are recorded and reported to the developers
at regular intervals for modifications.

7.2 TESTING OBJECTIVES

To uncover error in the software.

Demonstrates that software functions appear to be working according

to specifications, behavior and performance requirements are met.

A good indication of software reliability and some indication of

software quality as a whole.

7.3 UNIT TEST

Rules that serve as testing objective are as follows.

JAVA PAD
33

 Testing is a process of executing a program with the intent of finding

an error. A good test case is one that has high probabilities of finding

undiscovered error.

 A successful test is one that uncovers and discovered error. In this

type of testing step, each module was found to work satisfactorily

regards to the expected output from the module. Unit testing is

performed and found to be satisfactory in oops. There are thee

categories of tests that program unit can be tested. They are,

FUCTIONAL TESTING

PERFORMANCE TESTING

STRUCTURE TESTING

Software quality and relative are acceptable. Tests are inadequate to

uncover severe error.

Functional Testing

Functional testing is series of different tests whose primary purpose is

to fully exercise the computer based system. Although each test has

different purpose, all the work should verify that all system elements

have been properly integrated and perform allotted function, as well

as boundary values (minimum values, maximum values)and special

JAVA PAD
34

values etc.,.

Boundary condition is tested to ensure that the operator property at

boundaries established to limit or restrict prose.

Performance Testing

Performance testing is designed to test the run-tome performance of

software within the context of an integrated system.

Performance testing occurs throughout all steps in the testing process.

This test often coupled with stress testing and usually requires both

hardware and software instrumentation.

To measure resource utilization in an exacting fashion.

Structure Testing

This testing concern with exercising the internal logic of the program

and transferring particular execution path. Other restrictions placed

on the programs to structure testing are:

 Coincidental correctness doesn’t occur for any test case. If a

test, transverse an incorrect path the output values are different

from the values would be computed on correct path

 There are no missing path associated with the path been tested.

A test coverage criterion must be established for unit testing,

JAVA PAD
35

because program unit usually contains too many paths to

permit exhaustive testing.

7.4 INTEGRATION TESTING

Integration testing is a systematic technique for constructing the


program structure while at the same time conducting test to uncover error
associated with the interfacing the objectives is to taken unit is an
improvement approach to construction of program structure.

TOP-DOWN INTEGRATION
Top-Down integration testing is an incremental approach to
construction of program structure. Modules are integrated by moving
downward through the control.

BOTTOM-UP INTEGRATION
Bottom-Up integration testing begins construction and testing with
atomic modules, because components are integrated from bottom-up.

7.5 TESTING ACTIVITIES


In software testing we encounter a number of key activities:

 Test Plan
 Test design
 Test cases
 Test procedure

JAVA PAD
36

 Test execution
 Test report

A Test plan indicates the scope, approach, resources and the schedule
of testing activity. At this stage, one indicates what is to be or not to be
tested and which tasks to perform. In addition, it is necessary to identify the
sources and levels of risk in testing. Software testers are also identified. Test
planning may begin as soon as the requirements are completed. The key
features in a test plan are:

 Transitioning
 Estimates
 Completion
 Risk analysis
 Allocation

It is difficult to determine when to stop testing or when a reasonable


number of faults have been detected. For these reasons, criteria should be
provided as a guideline for test completion. A test design refines the
approach in a test plan.

Test design also identifies specific features to be tested by the design,


and define the associated test cases. It is strongly suggested that tests should
be designed for regression testing (test previously executed can be repeated
at a later point in development and maintenance).

JAVA PAD
37

The test cases and test procedures are constructed in an


implementation phase. One should strive for the most compact (smallest)
collection of test cases (batteries) that still meet the goal. Good test cases
have a high probability of detecting undiscovered errors.

A test procedure identifies all steps required to operate the system


and exercise the specified test cases to implement the already defined test
design.

Test execution is the exercising of the test procedures. Test execution


starts from the component level and moves up to the integration, system and
acceptance level.

A test report summarizes all outcomes of testing and highlights the


discrepancies detected. Sting activities are distributed across the entire
software life-cycle as shown in the figure

7.6 TEST ACTIVITIES IN SOFTWARE LIFE-CYCLE

JAVA PAD
38

Test plan
generatio
n
Requirements

Design Test design


Generation

Test case
Implementation Generation

Test
Test procedure
Generation

Test
execution

7.6 Testing Life Cycle

JAVA PAD
8
39

Chapter

Implementation
8.1 SYSTEM DESIGN

JAVA PAD
40

MAIN MENU

FILE EDIT SEARCH TOOLS HELP

UNDO FIND COMPILER ABOUT


NEW CUT FIND NEXT RUN ABOUT US
OPEN COPY FIND AND INTERFACES
SAVE DELETE REPLACE KEYWORDS
SAVE AS PASTE UPPER CALCULATOR
CLOSE SELECT LOWER COMPRESSION
EXIT ALL DECOMPRESSION
TIME/DATE
FONT

8.1 System design

8.2 INPUT PROCESS

JAVA PAD
41

The programs are written in the editor and it will be compiled and the
program should be run. Then inputs will be given as string values or as
integer value.

8.3 OUTPUT PROCESS


Now the Java pad run able source code will check the given input
value and it will produce the required output.

8.4 SAMPLE CODE


Compression
import java.util.zip.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
public class compression
{
JFileChooser fc;
File file,savefile;
JFrame f;
public compression(JFrame f)
{
try
{
fc = new JFileChooser();
int result = fc.showOpenDialog(f);
if(result == JFileChooser.APPROVE_OPTION)
JAVA PAD
42

{
file=(fc.getSelectedFile());
StringBuffer cut=new StringBuffer(file.getName());
//String des =file.getDescription();
//System.out.println(des);
For(int i=0;i<cut.length();i++)
{
if(cut.charAt(i)=='.')
{
System.out.println(i);
cut.replace(i+1,i+4,"cmp");
System.out.println(cut);
}
}
docomp(file);
}

if(result == JFileChooser.CANCEL_OPTION)
{
JOptionPane.showMessageDialog(null,"Sorry you choose
cancel option so No file is opened");
}
}
catch(Exception e)
{}
}
public void docomp(File dd)
JAVA PAD
43

{
file=dd;
byte plainb[]=null;
try
{
FileInputStream fis1=new FileInputStream(file);
int av=fis1.available();plainb=new byte[av];
fis1.read(plainb);
fis1.close();
String ccon=String.valueOf(plainb);
//t1.setText(ccon);
}
catch(Exception rer)
{
System.out.println("EERRRORRR! "+rer);
}

System.out.println("FileLoaded sucessfully");
byte[] input = plainb;
Deflater compre = new Deflater();
compre .setLevel(Deflater.BEST_COMPRESSION);
compre .setInput(input);
compre .finish();ByteArrayOutputStream bos = new
ByteArrayOutputStream(input.length);
byte[] buf = new byte[100000];
while (!compre .finished())
{
JAVA PAD
44

int count = compre .deflate(buf);


bos.write(buf, 0, count);
}
System.out.println("File commpressd successfully");
try
{
bos.close();
}
catch (IOException e)
{
System.out.println(e);
}

String compshow=bos.toString();
//t1.append(compshow);
byte []compressedfile=bos.toByteArray();
try
{
JOptionPane.showMessageDialog(null,"Please save the
compressed file with extension cmp");
JFileChooser jcsave=new JFileChooser(new
File("d:/coding/compressed"));
ExampleFileFilter filter = new ExampleFileFilter();
filter.addExtension("cmp");
filter.setDescription("cmp format files only");
jcsave.setFileFilter(filter);
int result1 =jcsave.showSaveDialog(f);
JAVA PAD
45

if(result1 == JFileChooser.APPROVE_OPTION)
{
System.out.println(result1);
savefile=jcsave.getSelectedFile();
}

StringBuffer gi=new StringBuffer(savefile.getAbsolutePath());


System.out.println("choosed file name"+gi);
FileOutputStream fos=new FileOutputStream(savefile);
fos.write(compressedfile);
fos.close();
if(result1 == JFileChooser.CANCEL_OPTION)
{

JOptionPane.showMessageDialog(null,"Sorry you choose cancel


option so compressed file is not stored");
}
}
catch(Exception e)
{
System.out.println("My file Exception "+e);
}
System.out.println("stored in to a file");
}
}
Decompression
import java.util.zip.*;
JAVA PAD
46

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
public class decompression
{
File openfile,savefile1;
JFrame f;
String ext;
public decompression()
{
try
{
JFileChooser jcopen=new JFileChooser();
int result=jcopen.showOpenDialog(f);
if(result==JFileChooser.APPROVE_OPTION);
{
openfile=jcopen.getSelectedFile();
}
String ext=openfile.getName();
}
catch(Exception e)
{}
dodecomp(openfile);
}
public void dodecomp(File ff)
{
JAVA PAD
47

openfile=ff;
ext=openfile.getName();
try
{
byte []deco=new byte[100000];
if(ext.substring(ext.length()-3).equals("cmp"))
{
FileInputStream dfis=new FileInputStream(openfile);
int i=dfis.available();
dfis.read(deco);
System.out.println("File loaded sucessfully");
Inflater decompress=new Inflater();
decompress.setInput(deco);
ByteArrayOutputStream ddcc=new
ByteArrayOutputStream(deco.length);
byte []codo=new byte[100000];
System.out.println("Decompression started");
try
{
while(!decompress.finished())
{
int count1=decompress.inflate(codo);
ddcc.write(codo,0,count1);
}
}
catch(Exception e)
{
JAVA PAD
48

System.out.println("byte write "+e);


}
System.out.println("decompression is finished");
try
{
ddcc.close();
}

catch(Exception e)
{
System.out.println("byte excep "+e);
}
byte []gi=ddcc.toByteArray();
try
{
JFileChooser jcsave1=new JFileChooser("d:/coding/Decompressed");
int result2=jcsave1.showSaveDialog(f);
if(result2==JFileChooser.APPROVE_OPTION)
{
savefile1=jcsave1.getSelectedFile();
}

String giri=savefile1.getAbsolutePath();
FileOutputStream dfos=new FileOutputStream(giri);
dfos.write(gi);
dfos.close();
JAVA PAD
49

}
catch(Exception e)
{
System.out.println(e);
}
system.out.println("decompressed file stored in original name");
}
else
{
JOptionPane.showMessageDialog(f,"select files have extension cmp
only","file extension error",JOptionPane.ERROR_MESSAGE );
}
}
catch(Exception e)
{
System.out.println("file open "+e);
}
}
}

public void actionPerformed(ActionEvent e)


{
if(e.getSource()==b1)
{
q1=p.t1.getText();
JAVA PAD
50

q2=t1.getText();
q3=t2.getText();
System.out.println(q1+" "+q2+" "+" "+q3);
StringPackage d=new StringPackage();
String s=d.getRegionMatches(q1,q2,q3);
p.t1.setText(s);
System.out.println(s);
}
if(e.getSource()==b2)
{
dispose();
}
}
/*public static void main(String ar[])
{
FindAndReplace fd=new FindAndReplace();
fd.show();
}*/
}

8.5 SCREEN SHOTS

JAVA PAD
51

8.5.1 Opening Screen

JAVA PAD
52

8.5.2 JAVA Applet

JAVA PAD
53

8.5.3 JAVA Library

JAVA PAD
54

8.5.4 JAVA awt

JAVA PAD
55

8.5.5 JAVA Calculator

JAVA PAD
56

8.5.6 JAVA Keywords

JAVA PAD
57

8.5.7 JAVA Compression

JAVA PAD
58

8.5.8 JAVA Message Box

JAVA PAD
59

8.5.9 JAVA Color Setting

JAVA PAD
60

8.5.10 JAVA Case Setting

JAVA PAD
61

8.5.11 JAVA Edit Controls

JAVA PAD
62

8.5.12 JAVA Open Dialog Box

JAVA PAD
63

8.5.13 JAVA Saving Option

JAVA PAD
64

8.5.14 JAVA Compilation

JAVA PAD 9
65

Chapter

Review and
Future
Enhancement

9.1 INTRODUCTON

Now we have understood about JAVA PAD. We can now create


our java programs without any difficulties that we face those days hence we

JAVA PAD
66

can easily edit and run programs without skipping form 1 window to another
window.

9.2 FUTURE ENHANCEMENT

All the projects which are created till now and which are going to
be created are not fully finished because the future programs may find some
advance concepts from our project.

As like others, may be my project may come with some additions


factors like including JSP,J2EE etc .,as I have created my project with
current important trends of java

JAVA PAD
10
67

Chapter

Maintenance

SYSTEM STUDY AND ANANLYSIS

JAVA PAD
68

System analysis phase of every project is the key phase and on


successfully completing it one will be directed in a path following which the
project runs smoothly. So care should be taken while doing system analysis.
Normally for any project existing system and proposed system are
analyzed under various aspects such as:
 Environmental
 Economical
 Technical
 End user
 Duration of the project

Environmental:

It is concerned with the type of environment in which the project is

being worked. This project can be worked on any platform as our source

language is java.

Economical:

This project was very much economical in all aspects. It was designed

to help various organizations/institutes to review their employees/students.

Technical:

This project was done using Java,

End user:

JAVA PAD
69

The test Generator can be used by any type of users even if they do not have

any computer knowledge as it is very much user friendly.

Duration of project:

This project has taken a total of 200 man hours in which 20 man hours
where taken for system analysis, 120 man hours for coding,30 man hours for
testing and 30 man hours for documentation.

JAVA PAD

11
70

Chapter

Conclusion

CONCLUSION

JAVA PAD
71

Till now we have seen about JAVA PAD, a new version of


java. The use of java software is becoming more than any of other programs.
Java languages which are all time peek language which cannot be overtake
by any other. Here we have seen so many functions that we use in java
language. We can use search options like find, find and replace options we
can view all the java library functions, we can use all the awt event
interfaces.
We can use calculator function, can view java keyword which
can be used in the programs, we use tools like compression, decompressions.
We can also use shortcut keys in java program, as in other software we can
get help from the users through offline and also through online. We can set
colors for our program.
Edit functions are inserted to our program. We can change our
coding into upper and lower case. Finally we can do all manipulations into
our java program. This software has been created to reduce the burden of the
programmers it will be helpful to all the programmers and also for the users.

JAVA PAD

12
72

Chapter

Bibliography

REFERENCES

JAVA PAD
73

1. Patrick Haughton, Herbert Schildt, “The Complete Reference-Java”, Tata


McGraw-Hill, III Edition, 2002.

2. Jamie jaworski,”Unleashed JAVA 2”, Tata McGraw-Hill, IV Edition.

3. Herbert Schildt, “Java 2 - The Complete Reference”, V Edition.

JavaAPI– http://java.sun.com

4. Bender W., Gruhul D., Morimoto N., “Techniques for data hiding”, IBM
Systems Journal, Vol 35, Nos 3&4, 1996.

JAVA PAD

You might also like