facebook

The active editor does not have a main type

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #244089 Reply

    John_Howard
    Member

    I get this message when attempting to run a jFreeChart application. Code:

    package chapter04b;

    import org.jfree.ChartFactory;
    import org.jfree.ChartFrame;
    import org.jfree.jFreeChart;
    import org.jfree.data.general.DefaultPieDataset;

    public class First3 {

    /**
    * @param args
    */
    public static void main(String[] args) {

    //create a dataset
    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue(“Category 1”, 43.2);
    dataset.setValue(“Category 2”, 27.9);
    dataset.setValue(“Category 3”, 79.5);

    // create a chart
    JFreeChart chart = ChartFactory.createPieChart(
    “Sample Pie Chart”,
    dataset,
    true, // legend?
    true, // toottips?
    false // URLs?
    );

    // create and display a frame
    ChartFrame frame = new ChartFrame(“First”, chart);
    frame.pack();
    frame.setVisible(true);

    }

    }

    What’s going on???

    TIA

    #244091 Reply

    Riyad Kalla
    Member

    Be sure to cross post to http://forums.java.sun.com, sometimes that can help get an answer faster.

    #251534 Reply

    Stanley
    Member

    I am having same problem when a try to right click on a class (that has a main method) and run as java application I get the error message “The active editor does not have a main type”

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: The active editor does not have a main type

You must be logged in to post in the forum log in