Java Editor Project
Java Editor Project
BY:-
POOJA SANDHU (1503372)
SAPNA DAWAR (1503366)
NEETU CHAHAL (1503348)
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
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 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.
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.
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.
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.
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.
FILE Contains option of New, Open, Close, Save, Save as, Exit
FEASIBILITY STUDY
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.
TECHANICAL
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.
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
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 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.
Reliability study
Focus on the activities of the project
SOFTWARE REQUIREMENT
HARDWARE REQUIREMENT
1) RAM – 128 MB
FUNCTIONAL REQUIREMENTS:
Essentials: -
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
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
There are main two stages that are included in this and they are:
Inception(Essential activities):
Elaboration(Essential activities):
Construction(Essential Activities):
1. Resource management, control, and process
optimization.
Transition(Essential Activities):
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].*;
/*************************************************************/
{
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]();
}
}
}
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 {
/**
* 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;
/**
* 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){
done = true;
dp = null;
} else if ([Link]()){
dp = (DocPosition)[Link]();
} else {
dp = null;
}
}
[Link](dpEnd);
}
synchronized (doclock){
t = [Link]();
}
}
workingIt = [Link](new
DocPosition([Link]())).iterator();
while ([Link]()){
[Link]();
[Link]();
}
[Link](newPositions);
[Link]();
/*workingIt = [Link]();
while ([Link]()){
[Link]([Link]());
}
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"
);
try {
[Link]([Link](), initString, getStyle("text"));
} catch (BadLocationException ble) {
[Link]("Couldn't insert initial text.");
}
}
private JMenuBar menuBar(){
[Link]();
[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();
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);
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() {
[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;
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
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
UNIT TESTING
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
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
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
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
Accuracy of Results,
Various types of errors were discovered while debugging the modules. These
ranged from errors to failure to account for various processing cases. Proper
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,
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
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.
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
4) [Link]