Creating New Files

Having created a new project, new files can be created and added. This is done via the New menu, already known from creating projects. A different way of creating files is the context menu of the navigation window that is opened by right-clicking the mouse. In the opening submenu, select the type of file you want to create.

Figure 9: Creation of New Files through the Context Menu

Figure 9 shows the available file types. Table 1 gives a textual summary of the file types:

File typeIconExtension
Java file .java
Image .jcif
Font .jcfd
Melody .imy
Tabelle 1: File Types, Icons and Extensions

The content of the menu for creating new files is context sensitive an it even depends on the current project type. That is why the menu's behaviour can differ more or less from the way shown in this example.

Once a file type is selected, a dialog appears that asks for the directory and the name of the new file. The button Change Path will open a file selector to browse for the directory where the new file should be created (fig. 10). A press on the button OK will create the new file which from now on will be displayed in the navigation window of the active project.

Figure 10: File Selector

New Java files can automatically get a main method by selecting the Create main method option (fig. 11). Listing 1 shows the newly created JAVA™ source code.

Figure 11: Dialog to Create New JAVA™ Files

1    /**
2     * Java file created by JControl/IDE
3     *
4     * @author Author
5     * @date   Date
6     *
7     */
8    public class Test {
9    
10        public Test() {
11            // add your code here
12        }
13    
14        public static void main(String[] args) {
15            new Test();
16        }
17    }
Listing 1: JAVA™ Source Code with Generated main Method