Rheza adjie panGEstu 171011400818
Lalu buat lah java
class seperti ini
Setalah itu masukan
import code dibawah ini
import
java.awt.GridLayout;
import
javax.swing.JFrame;
import
javax.swing.JPanel;
import
org.jfree.chart.ChartFactory;
import
org.jfree.chart.ChartPanel;
import
org.jfree.chart.JFreeChart;
import
org.jfree.chart.plot.PiePlot3D;
import
org.jfree.data.general.DefaultPieDataset;
import
org.jfree.data.general.PieDataset;
import
org.jfree.util.Rotation;
Lalu masukan
source code pada bagIan
button simpan
•rivate void
jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt)
{
int a,b,c,d;
a=Integer.parseInt(jTextField1.getText());
b=Integer.parseInt(jTextField2.getText());
c=Integer.parseInt(jTextField3.getText());
d=Integer.parseInt(jTextField4.getText());•
jLabel5.setText(""+a);
jLabel6.setText(""+b);
jLabel7.setText(""+c);
jLabel8.setText(""+d);
}
Kemudian masuka
source code grafik
private
void jToggleButton2ActionPerformed(java.awt.event.ActionEvent evt)
{
UTS_PieCovid19 pie = new
UTS_PieCovid19();
pie.setNilai(jLabel5.getText(),jLabel6.getText(),jLabel7.getText(),jLabel8.getText());
pie.setVisible(true);
}
Tidak ada komentar:
Posting Komentar