Example usage for org.jfree.chart ChartPanel updateUI

List of usage examples for org.jfree.chart ChartPanel updateUI

Introduction

In this page you can find the example usage for org.jfree.chart ChartPanel updateUI.

Prototype

@Override
public void updateUI() 

Source Link

Document

Updates the UI for a LookAndFeel change.

Usage

From source file:de.main.sessioncreator.ReportingHelper.java

public void addReport(JPanel jp) {
    jp.removeAll();// w  w  w  . jav  a  2 s . c  om
    PieDataset dataset = createDataset();
    // based on the dataset we create the chart
    JFreeChart chart = createChart(dataset, "Sessions by Tester");
    // we put the chart into a panel
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.updateUI();
    chartPanel.setSize(490, 350);

    jp.revalidate();
    jp.setOpaque(true);
    jp.add(chartPanel);
    jp.revalidate();
    jp.setVisible(true);
    jp.setSize(700, 500);
    jp.revalidate();
    jp.repaint();
}