Final Java Document
Final Java Document
PROJECT REPORT
Submitted for the course: Programming in Java(SWE1007)
By
GROUP MEMBERS REGISTRATION NUMBER
R.Rama Sai Akhil 15MIS0080
S.Aisvarya 15MIS0075
Sureka R 15MIS0238
SLOT: F1+TF1
NOVEMBER, 2016
1
CERTIFICATE
This is to certify that the project work entitled “TEXT EDITOR”
that is being submitted by
“R. Ram Sai Akhil,S.Aisvarya,Sureka.R” for Programming in
Java(SWE1007) is a record of bonafied work done under my
supervision. The contents of the project work, infull or inparts,
have neither been taken from any other sources nor have been
submitted for any other CAL course.
Place:Vellore
Date:
Sureka R
2
ACKNOWLEDGEMENT
I would like to express our special thanks of gratitude to my
respected teacher THANAPAL P and respected schools dean who
gave us the golden opportunity to do this wonderful project on
the topic Text editor in VIT University which also helped me in
doing a lot of Research and we came to know about so many new
things We are really thankful to sir.
HELPED US.
3
Contents:
1.INTRODUCTION
2. PROBLEM DEFINITION
2.1. FEATURES OF THE PROPOSED SYSTEM
3. SYSTEM REQUIREMENTS
4. IMPLEMENTATION
5.CONCLUSION
7. REFERENCES
4
ABSTRACT
Introduction:
1) A text
editor is a type of program used for editing plain text files. Such
programs are sometimes known as "notepad" software, following
the Microsoft Notepad
2) Text
editors are provided with operating systems and software
development packages, and can be used to change configuration files,
documentation files and programming language source code.
2. PROBLEM DEFENITION
1. This project aims to develop a simple text editor for a system. This software
can be accessed by
By any system that is reliable.
3. SYSTEM REQUIREMENTS
The following are the system requirements for online feedback collection
systems
4.IMPLEMENTATION
Main
Text Editor
Source
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package text.editor;
6
import java.awt.GraphicsEnvironment;
import java.awt.Font;
import java.io.*;
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
try{
GraphicsEnvironment ge=
GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT,new
File("fontawesome-webfont.ttf")));
}
catch(Exception e){
}
FIRST f1=new FIRST();
f1.setVisible(true);
}
1)COLOR
Source
package text.editor;
7
public class COLOR extends javax.swing.JFrame {
public COLOR() {
initComponents();
}
@SuppressWarnings("unchecked")
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
buttonGroup1.add(jRadioButton1);
jRadioButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton1.setText("Black");
buttonGroup1.add(jRadioButton2);
jRadioButton2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton2.setText("White");
buttonGroup1.add(jRadioButton3);
jRadioButton3.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton3.setText("Red");
buttonGroup1.add(jRadioButton4);
jRadioButton4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton4.setText("Green");
buttonGroup1.add(jRadioButton5);
jRadioButton5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton5.setText("Blue");
buttonGroup1.add(jRadioButton6);
1
0
jRadioButton6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton6.setText("Yellow");
buttonGroup1.add(jRadioButton7);
jRadioButton7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton7.setText("Orange");
buttonGroup1.add(jRadioButton8);
jRadioButton8.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton8.setText("Pink");
buttonGroup1.add(jRadioButton9);
jRadioButton9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton9.setText("Magenta");
buttonGroup1.add(jRadioButton10);
jRadioButton10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton10.setText("Cyan");
buttonGroup1.add(jRadioButton11);
jRadioButton11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton11.setText("Gray");
buttonGroup1.add(jRadioButton12);
jRadioButton12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton12.setText("Light Gray");
buttonGroup1.add(jRadioButton13);
jRadioButton13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jRadioButton13.setText("Dark Gray");
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(33, 33, 33)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(jRadioButton1)
.addComponent(jRadioButton5)
.addComponent(jRadioButton4)
.addComponent(jRadioButton3)
.addComponent(jRadioButton2)
.addComponent(jRadioButton11)
.addComponent(jRadioButton13)
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 118,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 85,
Short.MAX_VALUE)
1
2
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING, false)
.addComponent(jRadioButton6)
.addComponent(jRadioButton7)
.addComponent(jRadioButton8)
.addComponent(jRadioButton9)
.addComponent(jRadioButton10)
.addComponent(jRadioButton12,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(75, 75, 75))
.addGroup(layout.createSequentialGroup()
.addGap(121, 121, 121)
.addComponent(jLabel1)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jRadioButton1)
.addComponent(jRadioButton6))
1
3
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jRadioButton2)
.addComponent(jRadioButton7))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jRadioButton3)
.addComponent(jRadioButton8))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jRadioButton4)
.addComponent(jRadioButton9))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jRadioButton5)
.addComponent(jRadioButton10))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BA
SELINE)
.addComponent(jRadioButton11)
.addComponent(jRadioButton12))
.addGap(18, 18, 18)
.addComponent(jRadioButton13)
.addGap(18, 18, 18)
1
4
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING, false)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
37, Short.MAX_VALUE))
.addContainerGap(14, Short.MAX_VALUE))
);
pack();
}
java.util.logging.Logger.getLogger(COLOR.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(COLOR.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
1
5
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(COLOR.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(COLOR.class.getName()).log(java.util.logging
.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new COLOR().setVisible(true);
}
});
}
2)Find
Source
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package text.editor;
/**
*
*/
public class FIND extends javax.swing.JFrame {
/**
1
7
* Creates new form FIND
*/
public FIND() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents()
{
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jButton1.setText("Find Next");
jButton1.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Replace");
jButton3.setText("Exit");
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
1
9
layout.createSequentialGroup()
.addGap(47, 47, 47)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addComponent(jLabel2)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addComponent(jButton3,
javax.swing.GroupLayout.PREFERRED_SIZE, 79,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING)
.addComponent(jTextField2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jTextField1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 161,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
2
0
ING)
.addComponent(jButton1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 100,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.PREFERRED_SIZE, 100,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(41, 41, 41)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addGap(24, 24, 24)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
2
1
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38,
Short.MAX_VALUE)
.addComponent(jButton3)
.addGap(19, 19, 19))
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
2
2
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default
look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FIND.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FIND.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FIND.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FIND.class.getName()).log(java.util.logging.Lev
el.SEVERE, null, ex);
}
//</editor-fold>
Design
3)Font
Source
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
2
4
* and open the template in the editor.
*/
package text.editor;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* Creates new form FONT
*/
public Font selectedFont;
String fontString[] =
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNa
mes();
String fontSizeString[] =
{"10","12","14","16","18","20","22","24","28","40","60","80"};
String fontStyleString[] = {"Normal","Bold","Italic","Bold Italic"};
public FONT() {
super("Font Selector");
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
2
5
private void initComponents() {
jList1.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
jScrollPane1.setViewportView(jList1);
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
2
6
jComboBox1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jComboBox1.setModel(new
javax.swing.DefaultComboBoxModel(fontString));
jComboBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox1ActionPerformed(evt);
}
});
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING, false)
.addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
2
8
ING)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING, false)
.addComponent(jLabel3,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4)
.addComponent(jButton1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 83,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(68, 68, 68)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING, false)
.addComponent(jButton2,
javax.swing.GroupLayout.DEFAULT_SIZE, 112, Short.MAX_VALUE)
.addComponent(jComboBox3, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox2, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jComboBox1, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap(51, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
2
9
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jLabel1)
.addComponent(jComboBox1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(25, 25, 25)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jLabel2)
.addComponent(jComboBox2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(28, 28, 28)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jLabel3)
.addComponent(jComboBox3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(31, 31, 31)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jButton1)
3
0
.addComponent(jButton2))
.addGap(27, 27, 27)
.addComponent(jLabel4)
.addGap(29, 29, 29)
.addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 85,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(24, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
3
1
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default
look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
3
2
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(FONT.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(FONT.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(FONT.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FONT.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
}
//</editor-fold>
Design
3
4
4)First
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package text.editor;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.event.*;
import java.io.*;
import javax.swing.text.*;
import java.text.*;
import java.util.*;
import javax.swing.undo.*;
import javax.swing.event.*;
import java.net.*;
import javax.swing.text.JTextComponent;
return label;
}
public FIRST() {
super("Text Editor");
initComponents();
customInit();
}
public void customInit() {
textPanel.getDocument().addUndoableEditListener(undoMgr);
MouseListener popupListener = new PopupListener();
textPanel.addMouseListener(popupListener);
JMenuItem jMenuItema=new JMenuItem("Cut");
3
6
JMenuItem jMenuItemb=new JMenuItem("Copy");
JMenuItem jMenuItemc=new JMenuItem("Paste");
JMenuItem jMenuItemd=new JMenuItem("SelectAll");
pop.add(undoAction);
pop.add(redoAction);
pop.addSeparator();
pop.add(jMenuItema);
pop.add(jMenuItemb);
pop.add(jMenuItemc);
pop.add(jMenuItemd);
jMenuItema.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem9ActionPerformed(evt);
}
});
jMenuItemb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem10ActionPerformed(evt);
}
});
jMenuItemc.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem11ActionPerformed(evt);
}
});
jMenuItemd.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem17ActionPerformed(evt);
}
});
}
Design
3
7
5)Goto
Source
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package text.editor;
/**
* Creates new form GOTO
*/
public GOTO() {
initComponents();
}
3
8
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAI
LING)
.addGroup(layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jButton1))
.addGroup(layout.createSequentialGroup()
.addGap(30, 30, 30)
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67,
Short.MAX_VALUE)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 142,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(47, 47, 47))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
4
0
.addComponent(jLabel1)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jButton1)
.addContainerGap(17, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default
look and feel.
* For details see
4
1
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(GOTO.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(GOTO.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(GOTO.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(GOTO.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
}
//</editor-fold>
Design
6)Themes
Source
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package text.editor;
/**
* Creates new form THEMES
*/
public THEMES() {
4
3
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING, false)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(75, 75, 75)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD
ING, false)
.addComponent(jComboBox1, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(94, Short.MAX_VALUE))
);
4
5
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(31, 31, 31)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
23, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBox1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE
LINE)
.addComponent(jButton1)
.addComponent(jButton2))
.addContainerGap(38, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
java.util.logging.Logger.getLogger(THEMES.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(THEMES.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
4
7
java.util.logging.Logger.getLogger(THEMES.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(THEMES.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
}
//</editor-fold>
Design
4
8
Interfaces
COLOR
FONT FIND
4
9
GOTO THEMES
FIRST
6.Conclusion:
So basically the conclusion is we use the text editor in wide variety of aspects
To make the changes in text or to add more features or make the text more
attractive .Its major application is used in many programming languages like
Java
Text Editor is simple software which can be accessed by anyone
5
0
7.References
www.google.com
www.wikipedia.com
5
1