Git Product home page Git Product logo

ph-7 / simple-java-text-editor Goto Github PK

View Code? Open in Web Editor NEW
169.0 22.0 110.0 768 KB

:memo: PHNotepad is a simple Java text/code editor (notepad) written in Java. It has also nice features such as Search tool, Find/Replace text/code, Auto-completion, Nice Image Buttons for better UX, etc.

Home Page: https://ph-7.github.io/Simple-Java-Text-Editor/

License: Apache License 2.0

Java 100.00%
java notepad simple-java-ide java-text-editor text-editor teaching learning-java java-text editor java-note

simple-java-text-editor's Introduction

Simple Java Text Editor

PH NotePad is a simple and light text editor (notepad) written in Java.

Programming Java Text Editor

  • Search tool (to search text/keywords easily in the code) + highlighting the code found.

  • Find/Replace text/code.

  • Auto completion for Java and C++ keywords (files need to be saved as .java/.cpp). It can be easily expanded to support pretty much any number of languages.

  • Drag and Drop (drag files into the text area and they get loaded).

  • Nice image buttons for better UX.

Example Java Text Editor

AUTHOR

Pierre-Henry Soria

Contributors ๐Ÿ…

CONTACT

  • Pierre-Henry Soria: hi [AT] ph7 [D0T] me

  • Achintha Gunasekara: contact [AT] achinthagunasekara [D0T] com

DEMO

Download the Jar file and double click to run

Or run java -jar SimpleJavaTextEditor.jar from the command line

You can also generate easily a new jar file with the following command when you are in src/ directory jar cmvf ../manifest.mf ../SimpleJavaTextEditor.jar simplejavatexteditor/*.class

Important

Icons directory and its files must be present on the path when running the application (so you will have to move "icons/" into "src/" directory)

LICENSE

Apache License, Version 2.0 or later; See the license.txt file in the notepad folder.

simple-java-text-editor's People

Contributors

achinthagunasekara avatar ajmeese7 avatar akashdeepsingh9988 avatar frangametv avatar gpasents avatar jdevfullstack avatar marcusjrc avatar matthew22877288287 avatar ossilaukkanen avatar patrick-slagle avatar ph-7 avatar sidadan avatar tt-talhatariq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-java-text-editor's Issues

keywords highlighting

AutoComplete is awesome!

But I wonder how to implement the highlighting effect for the SupportKeywords?

Can you add this effect?

Any way to use word wrap?

Nice little notepad!

Cannot seem to figure out way to use "word wrap" or get scroll-bars to appear. Any ideas on solution?

Thanks!

Autocomplete when open file and Editor title

When opening a file (.java, .cpp), autocomplete doesn't work and the title of the editor doesn't change.

For the editor NAME the line behind could be added in the open actionlistener or a method could be created to avoid duplicate source code.

setTitle(file.getName() + " | " + SimpleJavaTextEditor.NAME);

For autocomplete option, line 434 to 468 could be added in the open actionlistener. Once again a method could be created to avoid duplicate source code.

I will propose a merge request if i find time to make these modifications

Best regards,

Emmanuel.

Embedding The Editor

How difficult would it be to embed this editor in a java beans application supporting story authoring?

unable to merge or commit

I added new font features to the text editor, but i am unable to merge files or adding pull request

#Bug, No check on open file option to save changes

Hi,
First of all, I really appreciate your work towards open source community.
I really wants to contribute in this project So, I started to test Text-editor and found some bug that there is no check on open file option to save changes if there is text in notepad.
can you please merge my pull request or add fallowing lines of code in your UI.java class for open file option.
// If the source was the "open" option
else if (e.getSource() == openFile || e.getSource() == openButton) {

    	  if (edit) {
              Object[] options = {"Save", "No Save", "Return"};
              int n = JOptionPane.showOptionDialog(this, "Do you want to save changes ?", "Question",
                      JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[2]);
              if (n == 0) {// save
                  saveFile();
                  edit = false;
              } else if (n == 1) {
                  edit = false;
                 openFile();
              }  
    		  
    	  }
    	 else{
       openFile();
    }
    }

private void openFile(){
JFileChooser open = new JFileChooser(); // open up a file chooser (a dialog for the user to browse files to open)
int option = open.showOpenDialog(this); // get the option that the user selected (approve or cancel)

     /*
      * NOTE: because we are OPENing a file, we call showOpenDialog~ if
      * the user clicked OK, we have "APPROVE_OPTION" so we want to open
      * the file
      */
     if (option == JFileChooser.APPROVE_OPTION) {
         FEdit.clear(textArea); // clear the TextArea before applying the file contents
         try {
             File openFile = open.getSelectedFile();
             setTitle(openFile.getName() + " | " + SimpleJavaTextEditor.NAME);
             Scanner scan = new Scanner(new FileReader(openFile.getPath()));
             while (scan.hasNext()) {
                 textArea.append(scan.nextLine() + "\n");
             }

             enableAutoComplete(openFile);
         } catch (Exception ex) { // catch any exceptions, and...
             // ...write to the debug console
             System.err.println(ex.getMessage());
         }
     }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.