Iniciando funcionalidad estadisticas
This commit is contained in:
29
src/VistaControlador/ControladorPanelLateral.java
Normal file
29
src/VistaControlador/ControladorPanelLateral.java
Normal 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");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user