Example usage for org.jfree.ui RefineryUtilities centerFrameOnScreen

List of usage examples for org.jfree.ui RefineryUtilities centerFrameOnScreen

Introduction

In this page you can find the example usage for org.jfree.ui RefineryUtilities centerFrameOnScreen.

Prototype

public static void centerFrameOnScreen(final Window frame) 

Source Link

Document

Positions the specified frame in the middle of the screen.

Usage

From source file:org.jfree.chart.demo.TimePeriodValuesDemo2.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored./*from  w ww  .j a v a2  s  .  c  om*/
 */
public static void main(final String[] args) {

    final TimePeriodValuesDemo2 demo = new TimePeriodValuesDemo2("Time Period Values Demo 2");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:org.jfree.chart.demo.AreaChartDemo1.java

public static void main(String args[]) {
    AreaChartDemo1 areachartdemo1 = new AreaChartDemo1("JFreeChart: AreaChartDemo1.java");
    areachartdemo1.pack();/* ww w  . j av  a2  s  . c  o  m*/
    RefineryUtilities.centerFrameOnScreen(areachartdemo1);
    areachartdemo1.setVisible(true);
}

From source file:org.jfree.chart.demo.TimeSeriesDemo1.java

public static void main(String args[]) {
    TimeSeriesDemo1 timeseriesdemo1 = new TimeSeriesDemo1("Time Series Demo 1");
    timeseriesdemo1.pack();/*from www. ja  va  2 s. c  o  m*/
    RefineryUtilities.centerFrameOnScreen(timeseriesdemo1);
    timeseriesdemo1.setVisible(true);
}

From source file:org.jfree.chart.demo.PeriodAxisDemo2.java

public static void main(String args[]) {
    PeriodAxisDemo2 periodaxisdemo2 = new PeriodAxisDemo2("Period Axis Demo 2");
    periodaxisdemo2.pack();/*  www  .j  a  v  a 2 s .c o m*/
    RefineryUtilities.centerFrameOnScreen(periodaxisdemo2);
    periodaxisdemo2.setVisible(true);
}

From source file:org.jfree.chart.demo.StackedBarChart3DDemo.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored./*from   ww w . java  2 s  .c  o m*/
 */
public static void main(final String[] args) {

    final StackedBarChart3DDemo demo = new StackedBarChart3DDemo("Stacked Bar Chart 3D Demo");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:org.jfree.chart.demo.XYSeriesDemo3.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored./*  ww  w.j a v  a 2s.co  m*/
 */
public static void main(final String[] args) {

    final XYSeriesDemo3 demo = new XYSeriesDemo3("XY Series Demo 3");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:edu.psu.citeseerx.misc.charts.CiteChartBuilderJFree.java

public static void main(String[] args) throws Exception {

    DataSource csxDataSource = DBCPFactory.createDataSource("citeseerx");
    DataSource cgDataSource = DBCPFactory.createDataSource("citegraph");

    CSXDAO csxdao = new CSXDAO();
    csxdao.setDataSource(csxDataSource);

    CiteClusterDAO citedao = new CiteClusterDAOImpl();
    citedao.setDataSource(cgDataSource);

    CiteChartBuilderJFree builder = new CiteChartBuilderJFree();
    builder.setCiteClusterDAO(citedao);// www.  j  a  v  a  2s .c  o  m

    Document doc = csxdao.getDocumentFromDB("10.1.1.1.3288", false, false);
    JFreeChart chart = builder.buildChart(doc);

    ApplicationFrame frame = new ApplicationFrame("Chart Test");
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new Dimension(500, 500));
    frame.setContentPane(chartPanel);
    frame.pack();
    RefineryUtilities.centerFrameOnScreen(frame);
    frame.setVisible(true);

}

From source file:com.mxgraph.examples.swing.chart.PieChartDemo1.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.//from   w w  w  . j  a  va  2 s.c om
 */
public static void main(String[] args) {

    // ******************************************************************
    //  More than 150 demo applications are included with the JFreeChart
    //  Developer Guide...for more information, see:
    //
    //  >   http://www.object-refinery.com/jfreechart/guide.html
    //
    // ******************************************************************

    PieChartDemo1 demo = new PieChartDemo1("Pie Chart");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);
}

From source file:org.jfree.chart.demo.LayeredBarChartDemo2.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored.//from  w ww . ja  va  2  s.c  o  m
 */
public static void main(final String[] args) {

    final LayeredBarChartDemo2 demo = new LayeredBarChartDemo2("Layered Bar Chart Demo 2");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}

From source file:org.jfree.chart.demo.XYAreaChartDemo2.java

/**
 * Starting point for the demonstration application.
 *
 * @param args  ignored./*from  w  w  w.j a  v a 2 s  .co m*/
 */
public static void main(final String[] args) {

    final XYAreaChartDemo2 demo = new XYAreaChartDemo2("XY Area Chart Demo 2");
    demo.pack();
    RefineryUtilities.centerFrameOnScreen(demo);
    demo.setVisible(true);

}