Search CTAT

NetBeans 7.0+ Configuration

This page is out of date. NetBeans is no longer supported. Return to the reference page.

Configure NetBeans if you'd like to create new Java student interfaces for use with CTAT.

0. Install NetBeans

Download NetBeans (Java SE version) from the NetBeans website and install it. NetBeans 6.9+ requires the Java Development Kit (JDK) version 6. On Mac OS X, you may need to configure your Mac OS to use Java 6.

1. Create a project for CTAT tutors

In this step you will create a new NetBeans project that will act as a container for all of your CTAT tutors including the examples.

  1. In NetBeans, select File > New Project
  2. Under Categories select Java; under Projects select Java Project with Existing Sources.
  3. Click Next
  4. Set the name and location of your project:
    1. Enter a name for your project in Project Name (e.g., "CTAT Tutors"). This project name is used by NetBeans to hold your CTAT tutors; you can name it anything you'd like.
    2. Set Project Folder to your CTAT installation directory (eg, "C:\Program Files\Cognitive Tutor Authoring Tools").
    3. Click Next.
    eek
  5. Set the existing sources for your project to {CTAT}\Projects:
    1. To the right of "Source Package Folders", click Add Folder, and select {CTAT}\Projects, where '{CTAT}' is the path to the directory where you installed CTAT.
  6. Click Next.

    Important: At the prompt to delete .class files, choose Ignore.

  7. On the Includes and Excludes screen, set the Includes field to */*.java
  8. Click Finish. Your new project should appear under both the 'Projects' and 'Files' tabs.

2. Add Java libraries for your project

CTAT tutors require a few libraries to compile.

  1. In the Projects tab, right-click on your new project's Libraries entry. Select Add JAR/Folder.
  2. Select and add {CTAT}\lib\ctat.jar.
  3. Repeat the above process, adding the folder {CTAT}\Projects.
  4. Add the following JAR files, found in the {CTAT}\lib directory:

    TableLayout.jar (needed for any interface with a JCommTable widget)
    jess.jar, junit.jar, and runcc.jar (needed for the LogicTutor example included with CTAT)
    logclient.jar (needed for any interface with a JCommDrawingPad widget)

    For CTAT 2.11.0 and earlier, also add AbsoluteLayout.jar

    All libraries listed in this step are required to prevent NetBeans from deleting all class files from the CTAT project. You should see a class file in each folder within {CTAT}\Projects (with the exception of those starting with "Flash" and the "ProblemsOrganizer" folder). If NetBeans deletes the class files before you have a chance to add these libraries, simply adding the missing JAR files to the project library as described above seems to fix the problem.

Your libraries should look like this:

3. Configure the location for class files

In this step, you will set the location into which CTAT produces Java class files. By default, the class files will go into a "classes" folder. For tutor authoring, it's better for class files to be stored in the same folder as the tutor interface you're working with.

  1. Click on the Files tab in the main NetBeans IDE.
  2. Expand the top-level CTAT project folder.
  3. Expand the folder nbproject.
  4. Open the project.properties file contained within nbproject by double-clicking it.
  5. In the "project.properties" file, change the value of the build.classes.dir property to read:
    build.classes.dir=${src.dir}
  6. Save and close project.properties.

4. Add the CTAT interface widgets

By adding the CTAT interface widgets, you'll be able to build a new tutor out of the widget building blocks.

Important: If you're upgrading to a new version of CTAT, you must remove the old interface widgets and template before continuing.

  1. Select Tools > Palette > Swing/AWT Components.
  2. Click Add from JAR
  3. Choose ctat.jar from the {CTAT}\lib directory.
  4. Select all of the available components—use CTRL+A on Windows, or Command+A on the Mac. Then click the Next.
  5. Select the Beans category, and click Finish
    Viewing the CTAT beans

5. Add the CTAT template file

When you create a new tutor with CTAT, you will use the a template Java file. In this step, you will add the template Java file to the collection of NetBeans templates.

  1. Under the Files tab in NetBeans, expand the folder TutorTemplates folder
  2. Right-click TutorTemplate.java, and select Save As Template from the pop-up menu.
  3. Select Swing GUI Forms as the template category, and click OK.

6. Test your new NetBeans configuration

In this step, you will test that NetBeans can run an existing student interface. You will also create and run a new student interface.

Run an existing student interface

  1. Right-click a CTAT Java file such as Projects\AdditionTutorChaining\TutorInterface.java and select Run File. Your tutor should compile and run.
    NetBeans run file
    Both the addition student interface and CTAT should appear. When they do, you can close them.

    If these windows do not appear, you may see an error window with the text "One or more projects were compiled with errors." and an error message in the output window
    Exception in thread "main" java.lang.NoClassDefFoundError.
    NetBeans may even delete all class files from each folder within {CTAT}\Projects.
    This most likely occurs because NetBeans is not configured to have access to all libraries. To fix this, add all JAR files specified in step 2. Then try running the tutor interface again.

Create and run a new student interface

  1. In the NetBeans IDE, right-click the Projects folder and choose New > Other
  2. Select the TutorTemplate you stored in the previous step. (It is likely under the category Swing GUI Forms.)
  3. In the New TutorTemplate.java dialog, enter both a file name for your tutor, and a location.

    Note: Your new tutor file must be created under the {CTAT}\Projects hierarchy. If it is not, your tutor will not compile.

  4. Press Finish.
  5. Right-click your new Java file and select Run File. Remember that errors in the output console are usually harmless and can be ignored.

You're done! Now you can create a new student interface in NetBeans or modify one of the existing ones. For tips on creating a student interface in NetBeans, try our tutorial “Building a student interface for fraction addition”.

Back to top