Iniciando funcionalidad estadisticas

This commit is contained in:
roche
2019-11-12 13:58:07 +01:00
parent da28be150a
commit 8af689363a
9 changed files with 118 additions and 30 deletions

View File

@@ -0,0 +1,29 @@
package VistaControlador;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.jfree.chart.ChartFrame;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.Plot;
import org.jfree.chart.plot.XYPlot;
public class ControladorPanelLateral implements ActionListener{
private VistaPanelLateral vista;
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals(this.vista.mostrarEstadisticas.getActionCommand())) {
XYPlot plot=new XYPlot();
JFreeChart chart=new JFreeChart(plot);
ChartFrame frame=new ChartFrame("Estadisricas", chart);
frame.setVisible(true);
}
}
private void aniadirElementos() {
this.vista.mostrarEstadisticas.addActionListener(this);
this.vista.mostrarEstadisticas.setActionCommand("Mostrar estadisticas");
}
}