Once the project is set up, you can create packages and files from the Projects window or the Files window. Right-click the node for the package or folder where you would like to add a class or package and choose New | File/Folder (Ctrl-N) to open the New File wizard. Or you can directly choose one of the templates below the File/Folder menu item. To create a Java package:
To create a file:
See Chapter 5 for more information on editing Java files. File TemplatesFile creation in the IDE begins with templates. The templates that are available depend on the features you have installed in the IDE. Following are some of the available categories. Java ClassesSeveral templates that provide skeleton code for basic types of classes, such as main classes, interfaces, and exceptions. Java GUI FormsSwing and AWT templates for developing visual desktop applications. When you create a file from one of these templates, the Form Editor opens, which enables you to build forms visually (dragging and dropping components from a palette to the Form Designer, changing properties in the Component Inspector, and so on). JavaBeans ObjectsVarious templates for classes that adhere to the JavaBeans component architecture. Included are templates for a bean with a skeleton getter and setter, BeanInfo classes, a property editor, and a customizer class. JUnitTemplates that provide skeleton code for unit tests of Java classes. Web ServicesTemplates for web service clients and WSDL files. XMLXML-related templates for XML documents, XML schemata, DTDs, XSL stylesheets, and cascading stylesheets. Ant Build ScriptsProvides a simple template for a simple skeleton for an Ant script and a template for a custom Ant task with detailed comments. These scripts could be useful if you want to extend the default behavior of the IDE's project system but are not necessary if the IDE's project system already provides all the features you need. WebProvides templates that are useful for web applications, including JSP files, HTML files, tag library files, and tag library descriptors (TLD files). Also provides Java class templates for servlets, filters, tag handlers, and web application listeners. See Chapter 8 for more information on working with these types of files. OtherProvides templates for HTML, properties, and empty files. Starting with a Blank FileIf you want to start with a completely blank file without a predetermined file extension, you can use the Other | Empty File template. If you give the file an extension that the IDE recognizes, the IDE will treat it as that type of file in the editor (complete with syntax highlighting and other Source Editor features). |