[01/14/20] Java Editor now supports multiple files
Bo Tinker published on 2020-01-15T04:11:33Z

Our "Java Editor" app has a new release. In this release, you can create multiple Java files in a single Java Project. Here are the updates:


1. "File" is now "Project"

The previous "File" button has now been updated to a "Project" button, where you can open / create / manage your Java projects. All of your previously existing Java files now exist within this "Project" folder and you can use "Project > Open" to find them all.


2. Three (3) new buttons in the main editor

  • "New File" button
  • The down-arrow button after the current file name
  • "Enter Full Screen" button


1) "New File" button

Suppose we want to create an OOP project, which contains 2 files: Main.java and Person.java, where the Person.java file contains a "Person" class which will be called in Main.java file.

Our "Main.java" code looks like this:

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Person p = new Person();
        p.setName("John Doe");
        System.out.println(p.getName());
    }
}


In order to create the "Person.java" file, click the "New File" button, and the editor will pop-up a modal from which you can input the file name "Person.java". When you click "Save", the new "Person.java" file will show up on the left in the "File List" section of editor. Now you can start coding this new "Person.java" file. When finished, click the "Run" button, and this project will be compiled and output the result in the right "Running Result" section of editor.


If you have more files for the project, you can keep adding files by clicking the "New File" button.


2) The down-arrow button after the current file name

The down-arrow button contains multiple operations for the current file. Suppose your current opened file is "Main.java", if you click the down-arrow button located directly next to it, you will be able to see a dropdown list of options:

  • Rename: Rename the current file name; for example, change "Main.java" to another name like "Hello.java"
  • Saving histories: Every time you save the project, each file will generate a saved version for the current content. With the "Saving histories" function, you can load a history version of that file. Up to ten (10) previous versions of file history will be saved.
  • Delete: Delete the current file.
  • Download: Download the current file. This will only download the current file, if you want to download the whole project, use "Project > Download".


3) The "Enter Full Screen" button

Full screen view will be very helpful when you are showing the code in a live teaching session, or you want to have more coding space to work within. By clicking this "Enter Full Screen" button, your editor will enter a full screen mode, from where you can further increase or decrease the text size. You can easily switch back to the normal editor by clicking the "Exit Full Screen" button.



3. Save Your Project

There are 3 ways to save a project now:

  • Click "Project" > "Save" button directly
  • After the first save, every time you click the "Run" button, your project will be auto saved.
  • Use key shortcuts: "Control + S" for PC, "Command + S" for Mac, it will then save the project