JAVA PAD
JAVA PAD
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.
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,.
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
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.
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
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.
JAVA PAD
8
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.
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
JAVA PAD
10
JAVA PAD
11
3. 3 SPECFICATION
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
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
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
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.2 JAVA
JAVA PAD
19
JAVA PAD
20
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.
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
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
JAVAC
JAVA
JAVA CLASS FILE
PAD JAVAH HEADER
JAVA JDB
JAVA PAD
JAVA PROGRAM
OUTPUT
29
7
JAVA PAD
30
Chapter
Testing
TESTING
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.
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.
JAVA PAD
33
an error. A good test case is one that has high probabilities of finding
undiscovered error.
FUCTIONAL TESTING
PERFORMANCE TESTING
STRUCTURE TESTING
Functional Testing
to fully exercise the computer based system. Although each test has
different purpose, all the work should verify that all system elements
JAVA PAD
34
values etc.,.
Performance Testing
This test often coupled with stress testing and usually requires both
Structure Testing
This testing concern with exercising the internal logic of the program
There are no missing path associated with the path been tested.
JAVA PAD
35
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.
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
JAVA PAD
37
JAVA PAD
38
Test plan
generatio
n
Requirements
Test case
Implementation Generation
Test
Test procedure
Generation
Test
execution
JAVA PAD
8
39
Chapter
Implementation
8.1 SYSTEM DESIGN
JAVA PAD
40
MAIN MENU
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.
{
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
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();
}
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
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);
}
}
}
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();
}*/
}
JAVA PAD
51
JAVA PAD
52
JAVA PAD
53
JAVA PAD
54
JAVA PAD
55
JAVA PAD
56
JAVA PAD
57
JAVA PAD
58
JAVA PAD
59
JAVA PAD
60
JAVA PAD
61
JAVA PAD
62
JAVA PAD
63
JAVA PAD
64
JAVA PAD 9
65
Chapter
Review and
Future
Enhancement
9.1 INTRODUCTON
JAVA PAD
66
can easily edit and run programs without skipping form 1 window to another
window.
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.
JAVA PAD
10
67
Chapter
Maintenance
JAVA PAD
68
Environmental:
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
Technical:
End user:
JAVA PAD
69
The test Generator can be used by any type of users even if they do not have
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
JAVA PAD
12
72
Chapter
Bibliography
REFERENCES
JAVA PAD
73
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