user interface - How do I create a pie chart in Java -


i want create pie chart displays percentages. how create pie chart using jframe in java?

this have far:

import javax.swing.*; import java.awt.*; import java.util.*;  public class piechart extends jframe{   private int midterm; private int quizzes; private int projects; private int final;  public piechart(){     setpercentage();  } private void setpercentage() {     // todo auto-generated method stub  } //construct pie chart percentages public piechart(int midterm, int quizzes, int final, int projects){ this.midterm = midterm; this.quizzes = quizzes; this.final = final; this.projects = projects; } //return midterm public int getmidterm(){     return midterm;  } //public void setmidterm(int midterm){     //this.midterm = midterm;     //repaint();  //} //return quizzes public int getquizzes(){     return quizzes;  } public int final(){     return final; } public int projects(){     return projects;  } //draw circle protected void paintcomponent(graphics g){     super.paintcomponents(g);  } //initialize circle parameters int circleradius =      (int)(math.min(getwidth(),getheight())* 0.4); int xcenter= getwidth()/2; int ycenter = getheight()/2;  } 

do have develop on own? or can use open source api? maybe jfreechart has can use.


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -