0% found this document useful (0 votes)
14 views72 pages

Java Editor Project

The document is a project report for a 'Java Editor' developed by students of Information Technology at Kurukshetra University. It includes sections on project introduction, feasibility study, design, coding, testing, maintenance, and implementation, as well as acknowledgments and references. The project aims to provide a complete solution for Java programming by simplifying the coding, compiling, and debugging processes.

Uploaded by

rajan saini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views72 pages

Java Editor Project

The document is a project report for a 'Java Editor' developed by students of Information Technology at Kurukshetra University. It includes sections on project introduction, feasibility study, design, coding, testing, maintenance, and implementation, as well as acknowledgments and references. The project aims to provide a complete solution for Java programming by simplifying the coding, compiling, and debugging processes.

Uploaded by

rajan saini
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

JAVA EDITOR

A MINOR PROJECT REPORT

SUBMITTED IN PARTIAL FULFILLMENT OF


THE REQUIREMENT FOR THE AWARD OF THE DEGREE OF
BACHELOR OF TECHNOLOGY
IN INFORMATION TECHNOLOGY
OF
KURUKSHETRA UNIVERSITY
KURUKSHETRA

BY:-
POOJA SANDHU (1503372)
SAPNA DAWAR (1503366)
NEETU CHAHAL (1503348)

UNDER THE GUIDANCE OF


( Miss. Divya Goel)

DEPARTMENT OF INFORMATION TECHNOLOGY


N.C COLLEGE OF ENGINEERING
ISRANA (PANIPAT)
JUNE-DEC 2006
CONTENTS

1) ACKNOWLEDGEMENT

2) CERTIFICATE

3) INTRODUCTION TO PROJECT

4) FEASIBILITY STUDY

5) PROJECT ANALYSIS
a) PROJECT PLANNING
b) PROJECT REQUIREMENT AND SPECIFICATION
c) COST BENEFIT ANALYSIS

6) PROJECT DESIGN
a) STAGES OF PROJECT DESIGN
b) I/O DESIGN AND FORM DESIGN

7) PROJECT CODING

8) PROJECT TESTING
a) UNIT TESTING
b) INTEGRATION TESTING

9) PROJECT MAINTENANACE

10) PROJECT SECURITY

11) PROJECT IMPLEMENTATION

12) CONCLUSION

13) REFERENCE
ACKNOWLEDGEMENT

It is a matter of great pleasure for us to present this project entitled “JAVA EDITOR”.
With great pleasure, we take this opportunity to express my profound sense of gratitude.
We keenly wish to express my sincere gratitude to our worthy principal Dr. Marwah for
providing us necessary facilities required.

We are thankful to [Link], Head of Department of Information Technology.

We also like to express my deepest gratitude to Miss. Divya Goel under whose
supervision I decided this project and for his valuable guidance, constructive criticism
and encouragement given to us during the completion of this seminar.

NEETU CHAHAL (1503348)


POOJA SANDHU (1503372)
SAPNA DAWAR(1503366)
CERTIFICATE

This is to certify that Sapna Dawar, Neetu Chahal, Pooja Sandhu are the students of
Information Technology. (Final year) Rollno.150336, 150348, 1503372 have completed
the dissertation entitled “JAVA EDITOR” under my supervision and they have
completed with all requirements of the ordinance for the submission of the dissertation.
This is their original work and this report is not submitted elsewhere for award of any
degree. I recommend that dissertation may be sent to evaluation.

Miss. Divya Goal Mr. [Link]

(PROJECT INCHARGE) H.O.D (IT. DEPT)


INTRODUCTION

INTRODUCTION TO JAVA EDITOR

The JEditor (Java Editor) provides complete solution to the real problem faced by the
user who uses this language regularly for many purposes. First opening the notepad and
saving in java extension and then running the particular file on the MS-DOS for the
output of the java file. Another Problem faced are they have to set the path of the Java
Bin to the MS-DOS so to run the particular java file and get the output. This path has to
be set by the user as many time the user log in. Which result lost of time of the user. And
the user gets annoyed with this problem.

JDebugger provides solution to this problem. By running the notepad on the screen or
frame to write the all coding part on that notepad and providing option to save, open and
new of the notepad. After saving the file the short cut is provided of compiling the file
giving the class file will be developed and then running the short cut option of running
the class file which will show the output on the screen on the same frame. We used
swings, awt, and [Link] brief description about these packages which we used to build up
the Frame.

Introducing Debugging in Java applications


In the early days of Java programming, a typical developer used a very archaic method of
debugging with the Java [Link]() method. Code traces were printed to the
console, a file, or a socket. It is a rare developer who creates perfect code the first time
around. Consequently, the market recognized the need for the types of debuggers that are
available for C++ programmers. Java developers now have at their fingertips a vast array
of debugging tools. Which tool you choose to use depends on your level of expertise.
Typically, beginners use GUI-oriented debuggers, while more experienced programmers
tend to avoid the WYSIWYG techniques in favor of having more control. No developer
should be without a debugger or debugging tools. Debuggers allow you to step through
code, freeze output, and inspect variables. Debugging tools help more experienced
developers locate more rapidly where problems are occurring.
Debugging is an art that every successful programmer needs to master sooner rather than
later. The sad truth is that program bugs appear almost as soon as you start coding.
Although a Java compiler always will detect syntax errors, often code that is syntactically
correct is not logically correct. These sorts of problems may require the help of a
debugger.
Sun's Java Development Kit (JDK) includes a debugger called JDB (Java Debugger), a
command-line application under which you can execute the programs you need to
inspect. With JDB, you can inspect variables while a program is running, set breakpoints
to halt the execution of a program at a certain point, and execute code line by line (known
as single-stepping). You can see just how the contents of variables change after each
statement of program code, and you can precisely trace the execution of a program--even
as it branches to other functions or iterates through loops.
JDB can be used to debug graphical programs and applets as well. An important thing to
note, though, is that the programs you debug must be compiled with the -g flag. This
causes the Java compiler to insert additional debugging information into the resulting
Java class file.
Debugging is an art that every successful programmer needs to master sooner rather than
later. The sad truth is that program bugs appear almost as soon as you start coding.
Although a Java compiler always will detect syntax errors, often code that is syntactically
correct is not logically correct. These sorts of problems may require the help of a
debugger.
Sun's Java Development Kit (JDK) includes a debugger called JDB (Java Debugger), a
command-line application under which you can execute the programs you need to
inspect. With JDB, you can inspect variables while a program is running, set breakpoints
to halt the execution of a program at a certain point, and execute code line by line (known
as single-stepping). You can see just how the contents of variables change after each
statement of program code, and you can precisely trace the execution of a program--even
as it branches to other functions or iterates through loops.
JDB can be used to debug graphical programs and applets as well. An important thing to
note, though, is that the programs you debug must be compiled with the -g flag. This
causes the Java compiler to insert additional debugging information into the resulting
Java class file.

Types of Java debuggers


There are several types of Java debugging techniques available:
IDEs contain their own debuggers (such as IBM VisualAge for Java, Symantec Visual
Cafe, and Borland JBuilder)
Stand-alone GUIs (such as Jikes, Java Platform Debugger Architecture java dt, and
JProbe)
Text-based and command-line driven (such as Sun JDB)
Brute force using an editor (such as Notepad or VI) and eyeballing stack traces

The versions of JDK, JSDI, JSP, and HTML you are using all have an impact on your
choice. IDE stand-alone GUI debuggers are the easiest for the novice programmer and
prove to e the most time efficient. The debuggers will lead you to where your program
crashed. Execute our program in the debugger, using a mouse to set breakpoints and step
through the source code. The downside of using these debuggers is that not all IDE
debuggers support the latest Java APIs and technologies (such as servlets and EJB
components).Text-based and the brute-force techniques offer more control but will
probably take longer for the less-experienced Java programmer to actually find bugs. We
call them the “poor man’s” debugger methods any of the above still do not meet your
needs, the Java platform has introduced the Java Debugging APIs, which you may use to
create a debugger that specifically meets your needs.

Common bug types


To give you a hint of what you are in for, we have listed below some common bugs that
developers have run into and squashed time and time again:
Compilation or syntactical errors are the first that you will encounter and the easiest to
debug. They are usually the result of typing errors.
Logic errors are different from run-time errors because there are no exceptions thrown,
but the output still does not appear as it should. These errors can range from buffer
overflows to memory leaks.
Run-time errors occur during the execution of the program and typically generate Java
exceptions.
Threading errors are the most difficult to replicate and track down.

Breakpoints: The Most Useful Debugger Feature


The most common debugging technique is placing a breakpoint in a source line where
you want to investigate either the state of variables or the visual appearance of the output
screen. You might use this technique when you have an if statement that never seems to
execute, for example. You might want to see the contents of the variables that are used in
the if statement's condition and find out to what they evaluate.
In fact, a breakpoint is the most useful feature in a debugger like JDB. It causes a running
program to pause execution at the point you specify. You can see what the user interface
looks like or examine any variables before resuming execution again. This feature is
tremendously useful for understanding exactly what is happening within a program.

Various debuggers support several types of breakpoints. Some of the most common are:
Line breakpoints are triggered before the code at a particular line in a program is
executed.
Method breakpoints are triggered when a method that has been set as a breakpoint is
reached.
Counter breakpoints are triggered when a counter assumes or goes beyond a particular
value.
Exception breakpoints are triggered when code throws a particular type of exception.
Storage change breakpoints are triggered when the storage within a particular storage
address range is changed.
Address breakpoints are triggered when the address a breakpoint is set for has been
reached.
If you are completely in the fog as to where the problem is, then you can set a breakpoint
at the beginning of your program in the main() method.
If your code generates a stack trace, set breakpoints at the area where it died in the stack
trace. You will see line numbers for the source code within the stack trace.
If a particular part of your output or graphical display is not presenting information
correctly (for example, a text field is displaying the wrong text), you can set a breakpoint
where the component is created. Then you can step through your code and display the
values that are assigned to the GUI object.

Inspecting variables
Typically a program is core dumping because a value of a variable is not set correctly.
The most common scenario is trying to compute or compare operations against variables
with null values or dividing by zero. The easiest way to find out if that is the case is by
inspecting the values where the error occurs. More likely than not, a variable did not get
assigned a value at the point you expected it to. Visual debuggers usually have a
monitoring window where they display the values of all the variables local to the current
class that you are currently in. Some debuggers even display the address of the variable
and may even let you dynamically change the value to see if the program will continue to
execute as you originally expected it to. Command-line debugger typically offer
commands to handle the same feature. Using the command line feature, you can even
investigate the entire contents of an array by displaying every row and column’s contents.
While most debuggers only show local variables that are in the scope of the class in a
monitoring window, some allow you to continue to monitor a variable after it falls out of
scope .Some debuggers support the viewing of registers. Note there are cases where
registers can only be viewed in compiled Java programs and not interpreted programs.
Presented by developer Works, your source for great tutorials [Link]/developerWorks.
Stack traces
When a Java program core dumps, it generates what is called a stack trace to the console
window. The stack trace tells the developer the exact path the program took to get to the
point where the problem occurred. The stack trace will state the class and method name
and the source code line number (if you compiled with the debug option). If you start at
the beginning of the trace and work down, you can proceed backwards through your code
to see what statements were actually executed. This is one way to quickly determine what
went wrong in your program. You can manually force the generation of a stack trace
using either the following statements.
Throw able() .print Stack Trace() to generate a trace of the method’s code at a single
point in time. The trace will show the method’s calls across threads.
Thread. [Link]() to generate a snapshot of the current thread only.
You want to force a stack trace when you need to understand under what conditions your
program generated its output. An example of forcing a stack trace appears below. This
code snippet method creates copies of files. We check if the copy succeeded by
comparing the length of both files. If they are not equal, we set up a trace to a file and
then force printing ofa stack trace (see the statement in bold). Throwable() is a class in
the java .Lang package. printStackTrace() is a method in the Throwable() class that prints
out a trace of your program execution path. You may find that line numbers are not
printed with your stack trace. It will simply say “compiled code.” To get line numbers,
disable the JIT compiler with either the no jit option or with the command-line argument
[Link]=NONE. However, it is not as important to get the line numbers if you get
the name of the method and the class it belongs to.

What is JDB?
Although there are some very good debugging tools available, the Java Debugger (JDB
offers some advantages. The most important is that JDB is freely available and is
platform independent. The downside is that it only comes in a command-line format,
which some developers find very primitive and difficult to use. Several IDEs have built
GUI interfaces to the JDB debugging APIs (such as Jikes).JDB comes as part of the JDK
installation. It has been enhanced in the Java 2 platform. refer to the section on the Java
Debugging APIs for more information JDB can be configured for debugging multiple
projects. JDB looks for a [Link] file in the user. home directory. Therefore,
you should set the user .home property to point to a different .ini file in another directory
for each project. You can do this by entering the command:
jdb -[Link]=. //Will look in the current directory for the [Link] file
The [Link] file can start a JDB session, pass in parameters, and display information about
the system. Below is an example of a [Link] file. It includes the Java platform sources on
the source path list and passes in the parameter 34 to the program. It then runs and stops
at line 2 and displays the free memory and waits for further input. You can record your
debugging sessions with JDB. Enable logging by creating a file called .agent Log in the
directory where you are running JDB. In the .agent Log file, put the filename that you
want the session information to be written to on the first line. When you run the jdb
command, you will see jdb session information. The log file could c

PACKAGES USED
AWT

AWT (Abstract Window Toolkit) contains numerous classes and methods that allow you
to create and manage windows. AWT that allows creation of the pop-up windows, menus
and dialogs. It also gives an introduction to creating stand alone Java programs using
AWT.
The AWT classes are contained in the [Link] package. It is one of the Java
largest packages. The main purpose of the AWT is to support applet windows; it can also
be used to create stand-alone windows that run in a GUI environment, such as Windows

SWINGS
Swings are a set of classes that provides more powerful and flexible functionality than is
possible with the AWT components. It gives the components of the buttons, check boxes,
and labels. It provides exciting additions, including tabbed panes, scroll panes, trees and
tables.
We made the main frame with the help of the swings we used the JButton,
JToolbar, JFrame, JScrollPane, JDesktopPane, JPanel, JMenuItem, JMenubar and many
more function to make the outlook of the mainframe. With the help we have given the
options which are provided to the notepad. We provided the all the short cut or we could
say the toolbar option with the help of the swings.

MAIN FRAME OF JAVA EDITOR

FILE Contains option of New, Open, Close, Save, Save as, Exit

EDIT Contains option of. Cut, Copy, Paste, Select all,

BUILD Contains the compile option ,the execute ,debug option.


FEASIBILITY STUDY

FEASIBILITY STUDY

Feasibility study before development or customization of software we think following


of the major points, which includes following: -

a) ECONOMICAL

b) TECHANICAL

c) DURATION

d) BEHAVIORAL

ECONOMICAL

This study about the software basically give the suggestion like if we develop a software
for our organization than how much it will forfeitable, workable as well as economical. If
we developing a software which very economical but not profitable there it is also wrong
decision. So for we economical study about the system table following of the point.

 How much costing of the software?


 What is the output of the customization?
 What are the advantages in compression manual we check
whether it is time or not?
 Whether it is use friendly or not?
 It is mountable for long term.
 Understanding about the software
 Corrective of software.

TECHANICAL

We also consider some technical points about development of software.

 We see whether the software is reliable or not.


 Whether it is work time for long time or not.
 What are the languages as well as OS is used for development of software.
 It provides security or not.
 Software is reusable or not.
 Software is updated or not.
 Software is flexible or not whether software can maintain.

DURATION

It is also a major point when we develop software. We also consider about time, how
much time software place to complete because for a big organization time factor is
money for full successful of the software also Tax some times so we have consider from
starting to last that means beginning to software.

1 5 days for requirement analysis and feasibility study


30 days for forms design, form connectivity.
45 days for coding
15 days for unit testing
15 days for integration testing
BEHAVIORAL

BEHAVIORAL FEASIBILITY

People are inherently resistant to change and computers have been known to facilitate
change. It is common knowledge that computer installations have something to do with
turnover, transfer, retraining and changes in employee job status. Therefore it is
understandable that the introduction of a candidate system requires efforts to educate, sell
and train the staff on new ways of conducting the business. This is true that we will have
to make the user aware how the system works. A person having some knowledge about
the presence of the system and proper good ascent can use this system.

Therefore the cost of training the users will be less. As computerized system lead to
change in the employee job status, therefore sometimes users or employees oppose the
installation of the system. But this case will not be here in this case as users will be easily
able to do the same work with less effort and time also. When all the matters related to
system will be explained to them, that what benefit they will be getting after the
installation of the system then they may start supporting the management. So after
studying all we come to this point that the system is completely behavioral feasible.
PROJECT ANALYSIS

PROJECT ANALYSIS-
An analysis is activity that feeds information to the specific activity. it is an outcome
of information gathered so far from documentation, from ideas discussion with people.

Project Planning

Once a project to find to be feasible, software project manager undertake project


planning. Project planning is undertaken and completed before any development activity
starts. Project planning consists of following activities

1) Estimating some basic attributes of the project as Duration


And Effort
2) Scheduling man power and other resources
3) Staff organization and staffing plans
4) Risk Identification, Analysis , Abatement Planning

Planning before doing is always a successful criterion. So making a plan before starting
a project is also very beneficial. In this, objectives are made clear so that we can meet our
target at time.
Generally in planning project we need to follow few planning guidelines because some
software projects span a broad range of application domains. It is valuable but risky to
make specific planning independent of project context. It is valuable because most people
in management positions are looking for a starting point, a thing they can flesh out with
project-specific details. They know that initial planning guidelines capture the expertise
and experience of many other people. Such guidelines are considered as the credible
bases of estimates and instill some confidence in the stakeholders. Project-independent
planning advice is also risky. There is the risk that the guidelines may be adopted blindly
without being adapted to specific project circumstances.
There are the following steps which we have to follow during planning:

[Link]:
It comprises of knowing the objectives which we have to meet while making a
project .Considering the objectives is the main thing during planning of a project. In this
we elaborate that what is our project’s work that is what will be the output provided by us
the stakeholders and regarding this concern we plan the input of the project. like in our
project we simply made clear in our mind that it will work something like Forum, and
thereafter we decided the input or requirements of the project.

2. ESTIMATE PLANNING:
The major estimates which we need to consider during planning are effort, cost, schedule.
The effort is the basic estimate we need to consider, like how much we have to work on
this project. Basically we specify it with the formula that is:
Effort= (Personnel) (Environment) (Quality) (Size^ Process)
The size is typically quantified in terms of source instructions.
The process used to produce the end product.
The capabilities of s/w engg personnel, and particularly their experience with the
computer science issues.
The environment, which is made up of the tools and techniques.
The required quality of the product including its features and performance.

In cost estimation we generally plan about


 Which cost estimation model to use?
 Whether to measure software size in source lines of code or function points.
 What constitutes a good estimate?

In schedule we have to consider the time limitations regarding our project .It generally
depends on the customer that after what amount of time he needs hi product ready. So we
have to plan our schedule according to that to meet the target or deadline.

[Link] MANAGEMENT:
Generally in this we have to do the risk analysis ,like what kind of risk our project can
face in future. It generally consist of the things like, will our project be completed with in
the estimated cost, on time and will it be able to work in the customer’s environment
properly. The actual risk exposure is predicted in the starting.

[Link] PLANS: They generally include

 Work Breakdown structures

 Reliability study
 Focus on the activities of the project

 Required tools and techniques.

Precedence ordering among planning activities


REQUIREMENT SPECIFICATION

SOFTWARE REQUIREMENT

1) JAVA BUILDER (J2SDK 1.5.0)

HARDWARE REQUIREMENT

1) RAM – 128 MB

2) Hard Disk space minimum 300 MB

3) Operating System WINDOWS 98 and above, NT

4) Processor PENTIUM III

FUNCTIONAL REQUIREMENTS:

Essentials: -

1. Should work properly in noisy environment.

2. Should work properly in the networking environment.


3. Should provide efficient result.
NON-FUNCTIONAL REQUIRMENTS:

Essentials:

1. Should be efficient.
2. Should not produce errors during working.
3. Should be compact and concise.
4. Should be attractive.
5. Should be extensible and flexible.
6. Should be complete and consistent.
COST BENEFIT ANALYSIS
Cost needed to be incurred in the software development and the benefits that will be
gathered from the software comes under cost benefit analysis. Generally the cost
comprises of the total of all the money spent on each and every element of the software.

Budgeting Defaults

Different Elements Default Budget


Management 10%
Environment 10%
Requirements 10%
Design 15%
Implementation 25%
Assessment 25%
Deployment 5%
Total 100%

Two explanations are necessary to avoid misinterpretation:

 The cost of different categories is inherent in these numbers. For example, the
management, requirements, and the design elements tend to use more
personnel who are senior and more highly paid than the other elements use. If
requirements and the design together consume 25% of the budget, this sum
may represent half as many staff hours as the assessment element, which also
accounts for 25% of the budget .
 The cost of hardware and software assets that support the process automation
and development teams is also included in the environment element.
System Analysis
Analyzing any piece of work means inspecting it to understand its properties and
capabilities. System Analysis refers to the process of examining a business situation with
the intent of improving it through better methods and procedures. In other words, analysis
phase defines the requirements of the system, independent of how these requirements will
be accomplished. This phase defines the problem that the customer is trying to solve.
System analysis in its core sense, deals with totally understanding the current system by
gathering and interpreting facts, diagnosing problems, and using the facts to improve the
current system.
That part or aspect of systems analysis that concentrates on finding out whether an
intended course of action violates any constraints is referred to as Feasibility Analysis or
Identification of Need. A systems analysis in which the alter-natives are ranked in terms
of effectiveness for fixed cost or- in terms of cost for equal effectiveness is referred to as
cost-effectiveness analysis. Cost benefit analysis is a study where for each alternative the
time stream costs and the time stream of benefits (both in monetary units) are discounted
to yield their present values.
The comparison and ranking are made in terms of net benefits (benefits minus cost) or
the ratio of benefits to costs. In risk-benefit analysis, cost (in monetary units) is assigned
to each risk so as to make possible a comparison of the discounted sum of these costs
(and of other costs as well) with the discounted sum of benefits that are predicted to result
from the decision. The risks considered are usually events whose probability of
occurrence is low, but whose adverse consequences would be important. All these issues
discussed in this paragraph under the topic of Preliminary Investigation.
PROJECT DESIGN

The goal of the design process is to produce a model or representation of a system, which
can be used later to build that [Link] produced model is called the design of the
[Link] design of the system is essentially a blueprint or a plan for a solution for the
system.

PROJECT DESIGN

STAGES OF PROJECT DESIGN

There are main two stages that are included in this and they are:

1. Engineering stage-The engineering stage, driven by less predictable but


smaller teams doing design and synthesis activities. It is further divided in to
two phases’ inception and elaboration.

 Inception(Essential activities):

1. Formulating the scope of the project.

2. Synthesizing the architecture.

3. Planning and preparing a business case.

 Elaboration(Essential activities):

1. Elaborating the vision.

2. Elaborating the process and infrastructure.

3. Elaborating the architecture and selecting components.

2. Production stage-The production stage, driven by more predictable but larger


teams doing construction, test, and deployment activities. It is further divided
in to two phases’ construction and transition.

 Construction(Essential Activities):
1. Resource management, control, and process
optimization.

2. Complete component development and testing against


evaluation criteria.

3. Assessment of product releases against acceptance


criteria of the vision.

 Transition(Essential Activities):

1. Synchronization and integration of concurrent


construction increments into consistent deployment
baselines.

2. Deployment-specific engineering (cutover, commercial


packaging and production, sales rollout kit development,
field personnel training).

3. Assessment of deployment baselines against the


complete vision and acceptance criteria in the requirement
set.
I/O DESIGN AND FORM DESIGN

MAIN FRAME
FILE OPTION
EDIT OPTION
BUILD OPTION
NEW
OPEN
SAVE AS
SELECT ALL
COMPILING PROGRAM
RESULT OF COMPILING
EXECUTE
RESULT OF EXECUTING
DEBUG
RESULT OF DEBUGGING
CONTENTPANE
EXIT

PROJECT CODING
PROJECT CODING
/*packages used for the code*/

package [Link];
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;

import [Link].*;
import [Link].*;
import [Link].*;
/*************************************************************/

class JavaCommands extends Thread /*class for setting java variables*/

{
static String path = "";
String JAVA_HOME = [Link]("[Link]");

Stringjava_dir=JAVA_HOME.substring(0,JAVA_HOME.lastIndexOf([Link]));
String compileCommand
=java_dir+[Link]+"bin"+[Link]+"[Link] ";
String runClassCommand
=java_dir+[Link]+"bin"+[Link]+"[Link] ";
String DebugClassCommand
=java_dir+[Link]+"bin"+[Link]+"[Link] -verbose ";
Process compile;
String errors;
BufferedReader br;
String command;
String classname,classpath;
public void compile(String filename) /*Mehod used for compilation of code*/

{
String line = "";
[Link]("");
try{
compile = [Link]().exec(compileCommand
+"\""+filename+"\"");
br = new BufferedReader(new
InputStreamReader([Link]()));
}
catch(Exception e){
[Link]("Error: "+e);
return;
}

try{
while (true) {
line = [Link]();
if(line != null){
[Link](line + '\n');
[Link](line+'\
n');
}
else
{
[Link]();
break;
}
}
}
catch(Exception e)
{
[Link]("\nAttempt to check
for errors failed");
[Link]();
return;
}
[Link]('\n'+"Process completed");
[Link](0);
}
public void runClass(String file){
Thread thead = new Thread(this);
command = runClassCommand;
classname=[Link]([Link]([Link])+1,[Link]()-
5);
classpath=[Link](0,[Link]([Link]));
start();
}
public void DebugClass(String file){
Thread thead = new Thread(this);
command = DebugClassCommand;
classname=[Link]([Link]([Link])+1,[Link]()-
5);
classpath=[Link](0,[Link]([Link]));
start();
}
public void run() {
try
{
compile = [Link]().exec(command +"-classpath "+"\""+classpath+"\"
"+classname);
}
catch(Exception e)
{
[Link]("\nFailed to execute [Link] "
+ "check the directory and try again");
return;
}
try
{
BufferedReader br = new BufferedReader(new
InputStreamReader([Link]()));

while(true)
{
String line = [Link]();
if (line == null)
{
[Link]();
break;
}
else if([Link]() > 0)
[Link]("\
nSystem: " + line + '\n');
}
[Link]();
}
catch(Exception e)
{
[Link]("\nRedirecting
[Link] failed");
[Link]();
}

[Link]('\n' + "Exception in thread


[main] [Link]: "+classname);

}
}

public class ProgrammerEditorDemo extends JFrame implements


ActionListener,CaretListener/*Main class*/
{
JPanel northPanel = new JPanel();
JToolBar toolBar = new JToolBar();
JDesktopPane desktop;
JTabbedPane desktopTabbedPane = new
JTabbedPane([Link]);
JPanel statusPanel=new JPanel(new BorderLayout());
JSplitPane splitPaneV;
JScrollPane textareaScrollPane;
JLabel col_row=new JLabel("Col: " + 0 + " Row: " + 0);
int document = 1,tabIndex=0;
String filePath;
JButtonnewButton,openButton,saveButton,saveAsButton,cutButton,copyButton
pasteButton,compileButton,runButton;
JButton[] toolbarButton=new JButton[9];
String[]toolbarImages={"new","open","save","saveas","cut","copy","paste","com
pile","run"};
JInternalFrame jif[]=new JInternalFrame[50];
JTextPane[] jta=new JTextPane[50];
boolean[] isChanged=new boolean[50];
String[] savedFileName=new String[50];
Font myFont=new Font("Courier",[Link],12);
static JTextArea errOutput=new JTextArea();
JMenuBar jmb = new JMenuBar();
JMenu jmFile = new JMenu(" File ");
JMenu jmEdit = new JMenu(" Edit ");
JMenu jmBuild = new JMenu(" Build ");

JMenuItem jmiNew,jmiOpen,jmiClose,jmiSave,jmiSaveAs,jmiExit;
JMenuItem jmiCut,jmiCopy,jmiPaste,jmiSelectAll;
JMenuItem jmiCompile,jmiExecute,jmiDebug;
JTextArea textarea;
/*********************/
protected HighLightedDocument hdocument;
protected DocumentReader documentReader;
protected Lexer syntaxLexer;
protected Colorer colorer;
JTextPane textPane;
private Object doclock = new Object();
public ProgrammerEditorDemo() {
super("Java editor");

/***********************************************************************
********************/
Container cp=getContentPane();
setJMenuBar(menuBar());
[Link](new BorderLayout());
addButtons(toolBar);
[Link]("North", toolBar);
[Link]("North",northPanel);
splitPaneV = new JSplitPane(JSplitPane.VERTICAL_SPLIT );
Dimension minimumSize = new Dimension(0, 500);
[Link](minimumSize);
[Link](desktopTabbedPane);
[Link](new JScrollPane(errOutput));
[Link](true);
[Link]("Center",splitPaneV);
[Link](col_row,[Link]);
[Link]("South",statusPanel);
int width=[Link]().getScreenSize().width;
int height=[Link]().getScreenSize().height;
setBounds( 0, 0, width, height - 50 );
show();
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
closeAllFrames();
[Link](0);
}
});

/***********************************************************************
**********/
colorer = new Colorer();
[Link]();
initStyles();
pack();
}
private class Colorer extends Thread {

private TreeSet iniPositions = new TreeSet(new DocPositionComparator());

/**
* As we go through and remove invalid positions we will also be finding
* new valid positions.
* Since the position list cannot be deleted from and written to at the same
* time, we will keep a list of the new positions and simply add it to the
* list of positions once all the old positions have been removed.
*/
private HashSet newPositions = new HashSet();

/**
* A simple wrapper representing something that needs to be colored.
* Placed into an object so that it can be stored in a Vector.
*/
private class RecolorEvent {
public int position;
public int adjustment;
public RecolorEvent(int position, int adjustment){
[Link] = position;
[Link] = adjustment;
}
}

/**
* Vector that stores the communication between the two threads.
*/
private volatile Vector v = new Vector();

/**
* The amount of change that has occurred before the place in the
* document that we are currently highlighting (lastPosition).
*/
private volatile int change = 0;

/**
* The last position colored
*/
private volatile int lastPosition = -1;

private volatile boolean asleep = false;

/**
* When accessing the vector, we need to create a critical section.
* we will synchronize on this object to ensure that we don't get
* unsafe thread behavior.
*/
private Object lock = new Object();

/**
* Tell the Syntax Highlighting thread to take another look at this
* section of the document. It will process this as a FIFO.
* This method should be done inside a doclock.
*/
public void color(int position, int adjustment){
// figure out if this adjustment effects the current run.
// if it does, then adjust the place in the document
// that gets highlighted.
if (position < lastPosition){
if (lastPosition < position - adjustment){
change -= lastPosition - position;
} else {
change += adjustment;
}
}
synchronized(lock){
[Link](new RecolorEvent(position, adjustment));
if (asleep){
[Link]();
}
}
}

/**
* The colorer runs forever and may sleep for long
* periods of time. It should be interrupted every
* time there is something for it to do.
*/
public void run(){
int position = -1;
int adjustment = 0;
boolean tryAgain = false;
for (;;){ // forever
synchronized(lock){
if ([Link]() > 0){
RecolorEvent re = (RecolorEvent)([Link](0));
[Link](0);
position = [Link];
adjustment = [Link];
} else {
tryAgain = false;
position = -1;
adjustment = 0;
}
}
if (position != -1){
SortedSet workingSet;
Iterator workingIt;
DocPosition startRequest = new DocPosition(position);
DocPosition endRequest = new DocPosition(position + ((adjustment>=0)?
adjustment:-adjustment));
DocPosition dp;
DocPosition dpStart = null;
DocPosition dpEnd = null;
try {

workingSet = [Link](startRequest);
dpStart = ((DocPosition)[Link]());
} catch (NoSuchElementException x){
dpStart = new DocPosition(0);
}
if (adjustment < 0){
workingSet = [Link](startRequest, endRequest);
workingIt = [Link]();
while ([Link]()){
[Link]();
[Link]();
}
}
workingSet = [Link](startRequest);
workingIt = [Link]();
while ([Link]()){
((DocPosition)[Link]()).adjustPosition(adjustment);
}
workingSet = [Link](dpStart);
workingIt = [Link]();
dp = null;
if ([Link]()){
dp = (DocPosition)[Link]();
}
try {
Token t;
boolean done = false;
dpEnd = dpStart;
synchronized (doclock){
[Link](documentReader, 0, [Link](), 0);
[Link]([Link]());
t = [Link]();
}
[Link](dpStart);
while (!done && t != null){
synchronized (doclock){
if ([Link]()<= [Link]()){
[Link](
[Link]() + change,
[Link]()-[Link](),
getStyle([Link]()),
true
);
// record the position of the last bit of text that we colored
dpEnd = new DocPosition([Link]());
}
lastPosition = ([Link]() + change);
}

if ([Link]() == Token.INITIAL_STATE){

while (dp != null && [Link]() <= [Link]()){


if ([Link]() == [Link]() && [Link]() >=
[Link]()){

done = true;
dp = null;
} else if ([Link]()){
dp = (DocPosition)[Link]();
} else {

dp = null;
}
}

[Link](dpEnd);
}
synchronized (doclock){
t = [Link]();
}
}

workingIt = [Link](dpStart, dpEnd).iterator();


while ([Link]()){
[Link]();
[Link]();
}

workingIt = [Link](new
DocPosition([Link]())).iterator();
while ([Link]()){
[Link]();
[Link]();
}

[Link](newPositions);
[Link]();

/*workingIt = [Link]();
while ([Link]()){
[Link]([Link]());
}

[Link]("Started: " + [Link]() + " Ended: " +


[Link]());*/
} catch (IOException x){
}
synchronized (doclock){
lastPosition = -1;
change = 0;
}

tryAgain = true;
}
asleep = true;
if (!tryAgain){
try {
sleep (0xffffff);
} catch (InterruptedException x){
}

}
asleep = false;
}
}
}
public void colorAll(){
color(0, [Link]());
}
public void color(int position, int adjustment){
[Link](position, adjustment);
}
private void initDocument() {
String initString = (
"/**\n" +
" * Simple common test program.\n" +
" */\n" +
"public class HelloWorld {\n" +
" public static void main(String[] args) {\n" +
" // Display the greeting.\n" +
" [Link](\"Hello World!\");\n" +
" }\n" +
"}\n"
);

syntaxLexer = new JavaLexer(documentReader);

try {
[Link]([Link](), initString, getStyle("text"));
} catch (BadLocationException ble) {
[Link]("Couldn't insert initial text.");
}
}
private JMenuBar menuBar(){

jmiNew = new JMenuItem(" New ");


[Link]([Link](KeyEvent.VK_N,
ActionEvent.CTRL_MASK));
[Link](new ImageIcon("images/[Link]"));
[Link](this);
[Link](jmiNew);
jmiOpen = new JMenuItem(" Open... ");
[Link](this);
[Link]([Link](KeyEvent.VK_O,
ActionEvent.CTRL_MASK));
[Link](new ImageIcon("images/[Link]"));
[Link](jmiOpen);
jmiClose = new JMenuItem(" Close ");
[Link](new ActionListener() {
public void actionPerformed(ActionEvent e) {
closeFrame();
}
});
[Link](jmiClose);
[Link]();
jmiSave = new JMenuItem(" Save ");
[Link](this);
[Link]([Link](KeyEvent.VK_S,
ActionEvent.CTRL_MASK));
[Link](new ImageIcon("images/[Link]"));
[Link](jmiSave);
jmiSaveAs = new JMenuItem(" Save As... ");
[Link](this);
[Link](new ImageIcon("images/[Link]"));
[Link](jmiSaveAs);
[Link]();
jmiExit = new JMenuItem(" Exit ");
[Link]([Link](KeyEvent.VK_F4,
ActionEvent.ALT_MASK));
[Link](this);
[Link](jmiExit);
//Edit Menu
jmiCut = new JMenuItem(" Cut ");
[Link]([Link](
KeyEvent.VK_X, ActionEvent.CTRL_MASK));
[Link](this);
[Link](jmiCut);
jmiCopy = new JMenuItem(" Copy ");
[Link](this);
[Link]([Link](
KeyEvent.VK_C, ActionEvent.CTRL_MASK));
[Link](jmiCopy);
jmiPaste = new JMenuItem(" Paste ");
[Link](this);
[Link]([Link](
KeyEvent.VK_V, ActionEvent.CTRL_MASK));
[Link](jmiPaste);
[Link]();
jmiSelectAll = new JMenuItem(" Select All ");
[Link]([Link](
KeyEvent.VK_A, ActionEvent.CTRL_MASK));
[Link](this);
[Link](jmiSelectAll);

[Link]();

jmiCompile = new JMenuItem(" Compile File ");


[Link](this);
[Link](jmiCompile);
jmiExecute = new JMenuItem(" Execute File ");
[Link](this);
[Link](jmiExecute);
jmiDebug = new JMenuItem(" Debug Info ");
[Link](this);
[Link](jmiDebug);

[Link](jmFile);
[Link](jmEdit);
[Link](jmBuild);

return jmb;
}
public void caretUpdate(CaretEvent e){
try
{
// int col = [Link]() -
jta[[Link]()].getLineStartOffset(jta[desktopTabbedPane.g
etSelectedIndex()].getLineOfOffset([Link]())) + 1;
// int row=
jta[[Link]()].getLineOfOffset([Link]()) + 1;
// col_row.setText("Col: " + col + " Row: " + row);
}
catch(Exception ex)
{[Link](ex);}
}
public void actionPerformed(ActionEvent e){
if (([Link]()==jmiNew)||([Link]()==toolbarButton[0]))
newFile(false,null);
else if (([Link]()==jmiOpen)||([Link]()==toolbarButton[1]))
openFile();
else if (([Link]()==jmiSave)||([Link]()==toolbarButton[2]))
save();
else if (([Link]()==jmiSaveAs)||([Link]()==toolbarButton[3]))
saveAs();
else if([Link]()==jmiCut || [Link]()==toolbarButton[4])
cut();
else if([Link]()==jmiCopy || [Link]()==toolbarButton[5])
jta[[Link]()].copy();
else if([Link]()==jmiPaste || [Link]()==toolbarButton[6])
paste();

else if([Link]()==jmiCompile || [Link]()==toolbarButton[7])


compile();
else if([Link]()==jmiExecute || [Link]()==toolbarButton[8])
execute();
else if([Link]()==jmiDebug)
debug();
else if([Link]()==jmiSelectAll){
jta[[Link]()].selectAll();

jta[[Link]()].requestFocus();
}
else if([Link]()==jmiExit){
closeAllFrames();
[Link](0);
}
}
void addButtons(JToolBar toolBar) {
for (int i=0;i<9;i++){
toolbarButton[i] = new JButton(new ImageIcon("images/"+toolbarImages[i]
+".gif"));
toolbarButton[i].setToolTipText(toolbarImages[i]);
toolbarButton[i].addActionListener(this);

if(i==1 ||i==4 || i==7 || i==9 || i==11) {


[Link](new [Link]());
[Link](toolbarButton[i]); }
else
[Link](toolbarButton[i]);
if (i!=0 && i!=1)
toolbarButton[i].setEnabled(false);
}
}
private void cut(){
JTextPane t=jta[[Link]()];
toolbarButton[7].setEnabled(true);
[Link]();
[Link]();
}
private void paste(){
JTextPane t=jta[[Link]()];
int start=[Link]();
[Link]();
int end =[Link]();
[Link](start);
[Link](end);
toolbarButton[7].setEnabled(true);
[Link](end);
[Link]();
}
private void newFile(boolean isSaved,String filename){
String title;
if(!isSaved){
title = "Document" + document; document++;
savedFileName[tabIndex]=null;
}
else
title = filename;
desktop=new JDesktopPane();
hdocument = new HighLightedDocument();
jif[tabIndex] = new JInternalFrame(title,true,true,true,true);
jta[tabIndex] = new JTextPane(hdocument);
jta[tabIndex].setFont(myFont);
jta[tabIndex].setCaretColor([Link]);
jta[tabIndex].setCaretPosition(0);
jta[tabIndex].setMargin(new Insets(0, 5, 0, 5));
documentReader = new DocumentReader(hdocument);
initDocument();
textareaScrollPane=new JScrollPane(jta[tabIndex]);

jif[tabIndex].getContentPane().add(textareaScrollPane);
ImageIcon icon = new ImageIcon("images/[Link]");
jif[tabIndex].setResizable(true);
jif[tabIndex].setSize(600, 395);
[Link](jif[tabIndex]);
[Link](title,icon,desktop,title);
[Link](tabIndex);
jif[tabIndex].setVisible(true);
isChanged[tabIndex]=false;

jta[tabIndex].addCaretListener(this);

jta[tabIndex].addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent evt) {
int key = [Link]();
JTextPane t=jta[[Link]()];

if(key!=KeyEvent.VK_BACK_SPACE){
toolbarButton[7].setEnabled(true);
}
else{
char last_char=[Link]().charAt([Link]()-1);
toolbarButton[7].setEnabled(true);
}

[Link]([Link](),jif[desktopTabbe
[Link]()].getTitle()+" * ");

isChanged[[Link]()]=true;

}
});

jif[tabIndex].addInternalFrameListener(new InternalFrameAdapter(){
public void internalFrameClosing(InternalFrameEvent e){
closeFrame();
}
});
tabIndex++;
[Link]("");
for (int i=2;i<9;i++)
toolbarButton[i].setEnabled(true);

}
private void closeFrame(){
int selectedIndex=[Link]();
if (isChanged[selectedIndex]){
int n = [Link](null,"Do you want to save
changes to "+
jif[selectedIndex].getTitle()+"?"
,"JEditor
1.0",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
if(n == JOptionPane.YES_OPTION){
if(savedFileName[selectedIndex]== null)
saveAs() ;
else
save();
}
}
[Link](selectedIndex); tabIndex--;
if ([Link]()==0){
for (int i=0; i<[Link];i++)
if(i!=0 && i!=1)
toolbarButton[i].setEnabled(false); [Link]("");

}
}
private void closeAllFrames(){
int last_tab_index=[Link]()-1;
while (last_tab_index>=0){
if (isChanged[last_tab_index]){
int n = [Link](null,"Do you want to
save changes to "+
jif[last_tab_index].getTitle()+"?"
,"JEditor
1.0",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE);
if(n == JOptionPane.YES_OPTION){
if(savedFileName[last_tab_index]== null)
saveAs() ;
else
save();
}
}
[Link](last_tab_index);
last_tab_index--;
}
}
private void openFile() {

FileDialog fd = new FileDialog(this, "Load File", [Link] );


[Link]();
String file = [Link]();
if ( file == null ) return;
try {
[Link]("hi");
String fullPath=[Link]()+[Link]();
FileInputStream fis = new FileInputStream (fullPath);
byte [] data = new byte [ [Link]() ];
[Link](data);
savedFileName[tabIndex]=fullPath;
newFile(true,file);
int index=[Link]();
[Link](index);
jta[index].setText(new String(data));
jta[index].setCaretPosition(0);
jta[index].requestFocus();
}
catch (IOException e ) {
[Link]("Could not load file..." );
}
}
private void save(){
int selectedIndex=[Link]();
try{
if(savedFileName[selectedIndex]==null)
saveAs();
else{
FileOutputStream fos=new
FileOutputStream(savedFileName[selectedIndex]);
[Link](jta[selectedIndex].getText().getBytes());
[Link]();

[Link](selectedIndex,jif[selectedIndex].getTitle());
}
}
catch(Exception e)
{
[Link]("Save Failed");
}
}
private void saveAs(){
int index=[Link]();
FileDialog fd = new FileDialog(this,"Save As",[Link]);
[Link](jif[[Link]()].getTitle());
[Link]();
if([Link]() == null)
return;
try{
String fullPath=[Link]()+[Link]();
FileOutputStream fos=new FileOutputStream(fullPath);
[Link](jta[index].getText().getBytes());
[Link]();

[Link](index,[Link]());
jif[[Link]()].setTitle([Link]());
savedFileName[tabIndex-1]=fullPath;
}
catch(Exception e)
{
[Link]("Save Failed");
}
}
private void compile(){
if(savedFileName[[Link]()] == null)
{
int n = [Link](null, " ","Java
editor",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);
if(n == JOptionPane.YES_OPTION)
saveAs();
else
return;
}
else
{
try
{
save();
JavaCommands c = new JavaCommands();

[Link](savedFileName[[Link]()]);
}
catch(Exception e)
{[Link](e);}
}
}
private void execute(){
int index=[Link]();
if(savedFileName[index] == null)
{
int n = [Link](null,"","Java
editor",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);
if(n == JOptionPane.YES_OPTION)
saveAs();
else
return;
}
else
{
try
{
JavaCommands c = new JavaCommands();
[Link](savedFileName[index]);
}
catch(Exception e)
{[Link](e);}
}
}
private void debug(){
int index=[Link]();
if(savedFileName[index] == null)
{
int n = [Link](null,"","Java
editor",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);
if(n == JOptionPane.YES_OPTION)
saveAs();
else
return;
}
else
{
try
{
JavaCommands c = new JavaCommands();
[Link](savedFileName[index]);
}
catch(Exception e)
{[Link](e);}
}
}
public static void main(String[] args) {
// create the demo
ProgrammerEditorDemo frame = new ProgrammerEditorDemo();
}
private Hashtable styles = new Hashtable();
private SimpleAttributeSet getStyle(String styleName){
return ((SimpleAttributeSet)[Link](styleName));
}
private void initStyles(){
SimpleAttributeSet style;

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("body", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, true);
[Link](style, false);
[Link]("tag", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("endtag", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("reference", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, new Color(0xB03060)/*[Link]*/);
[Link](style, true);
[Link](style, false);
[Link]("name", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, new Color(0xB03060)/*[Link]*/);
[Link](style, false);
[Link](style, true);
[Link]("value", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, true);
[Link](style, false);
[Link]("text", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("reservedWord", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("identifier", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, new Color(0xB03060)/*[Link]*/);
[Link](style, false);
[Link](style, false);
[Link]("literal", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, new Color(0x000080)/*[Link]*/);
[Link](style, false);
[Link](style, false);
[Link]("separator", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, true);
[Link](style, false);
[Link]("operator", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]());
[Link](style, false);
[Link](style, false);
[Link]("comment", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, new
Color(0xA020F0).darker()/*[Link]*/);
[Link](style, false);
[Link](style, false);
[Link]("preprocessor", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("whitespace", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("error", style);

style = new SimpleAttributeSet();


[Link](style, "Monospaced");
[Link](style, 12);
[Link](style, [Link]);
[Link](style, [Link]);
[Link](style, false);
[Link](style, false);
[Link]("unknown", style);
}
private class HighLightedDocument extends DefaultStyledDocument {
public void insertString(int offs, String str, AttributeSet a) throws
BadLocationException {
synchronized (doclock){
[Link](offs, str, a);
color(offs, [Link]());
[Link](offs, [Link]());
}
}

public void remove(int offs, int len) throws BadLocationException {


synchronized (doclock){
[Link](offs, len);
color(offs, -len);
[Link](offs, -len);
}
}
}
}
class DocPosition {
private int position;
int getPosition(){
return position;
}
public DocPosition(int position){
[Link] = position;
}
public DocPosition adjustPosition(int adjustment){
position += adjustment;
return this;
}
public boolean equals(Object obj){
if (obj instanceof DocPosition){
DocPosition d = (DocPosition)(obj);
if ([Link] == [Link]){
return true;
} else {
return false;
}
} else {
return false;
}
}
public String toString(){
return "" + position;
}
}

class DocPositionComparator implements Comparator{


public boolean equals(Object obj){
if (obj instanceof DocPositionComparator){
return true;
} else {
return false;
}
}
public int compare(Object o1, Object o2){
if (o1 instanceof DocPosition && o2 instanceof DocPosition){
DocPosition d1 = (DocPosition)(o1);
DocPosition d2 = (DocPosition)(o2);
return ([Link]() - [Link]());
} else if (o1 instanceof DocPosition){
return -1;
} else if (o2 instanceof DocPosition){
return 1;
} else if ([Link]() < [Link]()){
return -1;
} else if ([Link]() > [Link]()){
return 1;
} else {
return 0;
}
}
}

class DocumentReader extends Reader {


public void update(int position, int adjustment){
if (position < [Link]){
if ([Link] < position - adjustment){
[Link] = position;
} else {
[Link] += adjustment;
}
}
}
private long position = 0;
private long mark = -1;
private AbstractDocument document;
public DocumentReader(AbstractDocument document){
[Link] = document;
}
public void close() {
}
public void mark(int readAheadLimit){
mark = position;
}
public boolean markSupported(){
return true;
}
public int read(){
if (position < [Link]()){
try {
char c = [Link]((int)position, 1).charAt(0);
position++;
return c;
} catch (BadLocationException x){
return -1;
}
} else {
return -1;
}
}
public int read(char[] cbuf){
return read(cbuf, 0, [Link]);
}
public int read(char[] cbuf, int off, int len){
if (position < [Link]()){
int length = len;
if (position + length >= [Link]()){
length = [Link]() - (int)position;
}
if (off + length >= [Link]){
length = [Link] - off;
}
try {
String s = [Link]((int)position, length);
position += length;
for (int i=0; i<length; i++){
cbuf[off+i] = [Link](i);
}
return length;
} catch (BadLocationException x){
return -1;
}
} else {
return -1;
}
}
public boolean ready() {
return true;
}
public void reset(){
if (mark == -1){
position = 0;
} else {
position = mark;
}
mark = -1;
}
public long skip(long n){
if (position + n <= [Link]()){
position += n;
return n;
} else {
long oldPos = position;
position = [Link]();
return ([Link]() - oldPos);
}
}
public void seek(long n){
if (n <= [Link]()){
position = n;
} else {
position = [Link]();
}
}
}
PROJECT TESTING

PROJECT TESTING

Testing

The basic purpose of the testing phase is to detect the errors that may be present in the
program. However often the aim of testing is to demonstrate that a program works by
showing that it has no errors. This is opposite of what testing should be viewed as.
Hence, one should not start testing with the intent of showing that a program works; but
the intent should be to show that a program does not work. So Testing can be defined as:
Testing is the process of executing a program with the intent of finding errors.

Testing a large system is a complex activity, and like any complex activity it has to be
broken into smaller activities. Due to this, for a project, Incremental Testing is generally
performed, in which components and subsystems of the system are tested separately
before integrating them to form the system for system testing. This form of testing,
though necessary 0 ensure quality for a large system, introduces new issues of how to
select components for testing and how to combine them to form subsystems and systems.
In' other words integration of various components of the systems is an important issue
that the testing phase has to deal with. For this reason this phase is sometimes called
"integration and testing"

Testing performs a very critical role for quality assurance and for ensuring reliability of
software. During testing, the program to be tested is executed with set of test cases and
output of program for test cases is evaluated to determine if program is performing as
expected. Testing forms the first step in determining errors in programs. The success of
testing in revealing errors in programs depends on test cases ..
Any engineered product can be tested in one of the two ways:

1. Knowing specified function that a product has been designed to perform; tests can be
conducted that demonstrates that each function is fully operational while at the same time
searching for errors in each function. This is called Black Box testing.

2. Knowing internal working of the project, test can be conducted to ensure that all
internal operations are performed according to specification and all internal components
have been adequately exercised. This is called White Box testing.

During system testing, the system is used experimentally to ensure that the

software does not fall, i.e. it will run according to specification and in the way users

expect. Special test data input for processing and the result examination. A limited

number of users may be allowed to use the system so that analysis can see whether they

use it in unforeseen ways. It is preferable to discover any surprises the organization

implements the system and encounters them later on. This type of testing which allows

only a few, selected users to work on the system is known as BETA TESTING. On the

other hand the testing done by the developer (s), themselves is known as ALPHA

TESTING.

Testing is generally performed by persons other than those who the original

programs to ensure complete and unbiased testing and more reliable software.
The norms followed during the testing phase were thoroughly tested by me, the

developer; I was required to release the program’s source code. The source code was

copied into the area. If some changes were desired in the program, I was suitably

informed and was required to make the necessary modifications.

UNIT TESTING

Unit testing is the testing of a single program module in an isolated environment.

The testing of the processing procedure is the main focus. In this regard, all the modules

were separately tested first as isolated and complete entities. This helped a lot in

discovering problems related to a single module and rectifying them in the contest of the

module itself, rather than considering module-related problem in a global context.

INTEGRATION TESTING

Integration testing is the process of testing the interfaces among system modules.
Some testing ensures that data moves between systems as intended. In the regard of a
particular module was obtained in correct format, so that the next module could accept it
appropriately. This could be done either after the entire system was developed, or in
stages than one module was developed.
PROJECT MAINTENANCE

PROJECT MAINTAINENCE-
Maintenance is a fact of life in the development of information systems. However the

making of changes & adjustments don’t necessarily signal correction of error or the

occurrence of problems.

Among the most frequent changes requested by end users is the addition of
information to a report format. Information requirements may be revised as the result of
system usage or changing operational needs. Perhaps oversights that occurred during the
development process need to be corrected.
Often, the need arises to capture additional data for storage in a database or

perhaps when it is necessary to add error detection features to prevent system users from

inadvertently taking an unwanted action.

These are the realities of application maintenance, when they occur, however they

are an indication that the system is being used & that it is serving a useful function rather

than being ‘’shelved’’ by the intended, such as :

 More accurately defining the user’s requirements during system development.

 Assembling better systems documentation.

 Making better use of existing tools & techniques.


 Including proper comments.

PROJECT IMPLEMENTATION

PROJECT IMPLEMENTATION-
Implementation, literally, means to put into effect or to carry out. The system
implementation phase of software engineering deals with all activities that take place to
convert from the old system to the new. Proper implementation is essential to provide
system to meet organization’s requirements.
During the implementation phase debugging, documentation of the system was

created out, module in the project for

 Accuracy of Results,

 Minimization of response Time,

 Clarity and Simplicity of the code,

 Minimization of Hard –Coding i.e. (a generic approach was followed )

 Minimization of amount of memory used.

Various types of errors were discovered while debugging the modules. These

ranged from errors to failure to account for various processing cases. Proper

documentation of each module was done by embedding comments in the executable

portion of the code. To enhance the readability, comments, indentation, parenthesis, black

spaces, blank lines and borders were around the blocks of comments. Care was taken to
use descriptive names for table, field, modules, forms etc., the proper use of indentation,

parenthesis and blank lines was also ensured during coding.

Testing of the Report Generation module was carried out to find out the response

time of the system for the generating reports. To make the response time negligible.

CONCLUSION

CONCLUSION

FUTURE SCOPE OF THE PROJECT:

The purpose of this document is to solve the problem. Those always have to set the path
for java files with the ̉[Link] this the user can create java file on the same frame and
run on the same frame or could see the output of that frame to get the result. Hence it has
greater scope as java is used all over the world.

CONCLUSION:

The working on this project has been a great learning experience. While
working on this project we got a good exposure to [Link] coding we were
exposed to the strength and weakness of Java.

Apart from that, the hard work and cooperation of all the team members
made us aware that how much of dedication, team spirit and diligence goes in to
making of successful project.

Developers always try to make every program or system to be perfect and


bug free. But as the saying goes” human is to err”, there may be some
shortcomings left in final project.
Developers always try to design there product as much user friendly
as they can, but unless and until product is used by user, developers cannot pre-
examine every flaw that may later be encountered. The difference may result in
user dissatisfaction, as by the time user needs may have changed. So the result of
communication gap and time difference in product developing and receiving may
lead to errors.

And as in this field, technology changes everyday, developer can never


ensure complete satisfaction to user.

But the product has been built in such a way that it can be enhanced with
ease, as the overall approach followed is Java and flexible in enough to
incorporate modification.

REFERENCE

1) COMPLETE REFERENCE BY HERBERT SCHILDT

2) CORE JAVA VOL II BY SUN MICROSYSTEM

3) THINKING IN JAVA BY BRUCE ECKEl

4) [Link]

You might also like