notepad project report in java pdf
#1

Sir plzz send the full project report on notepad editor in java
Reply
#2

Notepad Functions in Java

• File Bar, Edit and Help menu bar
• Ability to create a new notebook
• Save and load a .TXT file.
• Edit texts with cut, copy and paste functions
• About the dialog box
• Resizable window
• Keyboard shortcuts for various functions

As seen in the above features, our copy of Java does not completely mimic everything that Notepad does. For example, there is no option to change font settings, to turn Word Wrap on / off, to show / hide the status bar (to display the line and the position column of the text cursor) and a help and support window for a Extensive list of features of the text editor. Although present, the Undo function is only for display in our Java program and will not revert any recent action performed by the user. Other differences are also present, many of which are subtle.


Code is here:


Code:
Notepad

import java.awt.*;
import java.awt.event.*;
import java.awt.datatransfer.*;
import java.io.*;
public class Editor extends Frame
   {
    String filename;
    TextArea tx;
    Clipboard clip = getToolkit().getSystemClipboard();
    Editor()
        {
        setLayout(new GridLayout(1,1));
        tx = new TextArea();
        add(tx);
        MenuBar mb = new MenuBar();
        Menu F = new Menu("file");
        MenuItem n = new MenuItem("New");
        MenuItem o = new MenuItem("Open");
        MenuItem s = new MenuItem("Save");
        MenuItem e = new MenuItem("Exit");
        n.addActionListener(new New());
        F.add(n);
        o.addActionListener(new Open());
        F.add(o);
        s.addActionListener(new Save());
        F.add(s);
        e.addActionListener(new Exit());
        F.add(e);
        mb.add(F);
        Menu E = new Menu("Edit");
        MenuItem cut = new MenuItem("Cut");
        MenuItem copy = new MenuItem("Copy");
        MenuItem paste = new MenuItem("Paste");
        cut.addActionListener(new Cut());
        E.add(cut);
        copy.addActionListener(new Copy());
        E.add(copy);
        paste.addActionListener(new Paste());
        E.add(paste);
        mb.add(E);
        setMenuBar(mb);
       
        mylistener mylist = new mylistener();
        addWindowListener(mylist);
    }
   
    class mylistener extends WindowAdapter
        {
        public void windowClosing (WindowEvent e)
            {
            System.exit(0);
        }
    }
   
    class New implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            tx.setText(" ");
            setTitle(filename);
        }
    }
   
    class Open implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            FileDialog fd = new FileDialog(Editor.this, "select File",FileDialog.LOAD);
            fd.show();
            if (fd.getFile()!=null)
                {
                filename = fd.getDirectory() + fd.getFile();
                setTitle(filename);
                ReadFile();
            }
            tx.requestFocus();
        }
    }
   
    class Save implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            FileDialog fd = new FileDialog(Editor.this,"Save File",FileDialog.SAVE);
            fd.show();
            if (fd.getFile()!=null)
                {
                filename = fd.getDirectory() + fd.getFile();
                setTitle(filename);
                try
                    {
                    DataOutputStream d = new DataOutputStream(new FileOutputStream(filename));
                    String line = tx.getText();
                    BufferedReader br = new BufferedReader(new StringReader(line));
                    while((line = br.readLine())!=null)
                        {
                        d.writeBytes(line + "\r\n");
                        d.close();
                    }
                }
                catch(Exception ex)
                    {
                    System.out.println("File not found");
                }
                tx.requestFocus();
            }
        }
    }
   
    class Exit implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            System.exit(0);
        }
    }
    void ReadFile()
        {
        BufferedReader d;
        StringBuffer sb = new StringBuffer();
        try
            {
            d = new BufferedReader(new FileReader(filename));
            String line;
            while((line=d.readLine())!=null)
            sb.append(line + "\n");
            tx.setText(sb.toString());
            d.close();
        }
        catch(FileNotFoundException fe)
            {
            System.out.println("File not Found");
        }
        catch(IOException ioe){}
    }
   
    class Cut implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            String sel = tx.getSelectedText();
            StringSelection ss = new StringSelection(sel);
            clip.setContents(ss,ss);
            tx.replaceRange(" ",tx.getSelectionStart(),tx.getSelectionEnd());
        }
    }
   
    class Copy implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            String sel = tx.getSelectedText();
            StringSelection clipString = new StringSelection(sel);
            clip.setContents(clipString,clipString);
        }
    }
   
    class Paste implements ActionListener
        {
        public void actionPerformed(ActionEvent e)
            {
            Transferable cliptran = clip.getContents(Editor.this);
            try
                {
                String sel = (String) cliptran.getTransferData(DataFlavor.stringFlavor);
                tx.replaceRange(sel,tx.getSelectionStart(),tx.getSelectionEnd());
            }
            catch(Exception exc)
                {
                System.out.println("not string flavour");
            }
        }
    }
   
    public static void main(String args[])
        {
        Frame f = new Editor();
        f.setSize(500,400);
        f.setVisible(true);
        f.show();
    }
}
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Tagged Pages: project report for notepad pdf,
Popular Searches: seminar for notepad application in java, project report on notepad in java pdf, notepad in java ppt, project report on notepad in java ppt, project report on notepad java, best synopsis format for notepad in java, java notepad project and project report,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  I need this pdf for my project 0 1,520 31-03-2021, 01:42 PM
Last Post:
  project report 0 3,838 12-09-2020, 07:27 PM
Last Post:
  Project on plastic money in Marathi pdf... 0 3,787 31-05-2020, 03:29 PM
Last Post:
  Report in PDF format 0 7,373 18-05-2020, 11:28 AM
Last Post:
  Multi purpose machine project report 0 2,109 20-02-2019, 10:23 AM
Last Post:
  class 12 business studies project on marketing management pdf on mobile phones 3 3,594 20-12-2018, 12:16 AM
Last Post:
  civil engineering extensive survey project report 0 2,239 03-11-2018, 11:26 PM
Last Post: Guest
  fire alarm project for class xii pdf 0 1,187 31-10-2018, 08:37 PM
Last Post: Guest
  to construct a switch using a transistor project pdf 0 827 27-10-2018, 11:07 PM
Last Post: Guest
  project on marketing management for class 12 on chocolate pdf 0 1,061 26-10-2018, 09:24 PM
Last Post: Guest

Forum Jump: