Example usage for org.jfree.ui RefineryUtilities positionFrameOnScreen

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

Introduction

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

Prototype

public static void positionFrameOnScreen(final Window frame, final double horizontalPercent,
        final double verticalPercent) 

Source Link

Document

Positions the specified frame at a relative position in the screen, where 50% is considered to be the center of the screen.

Usage

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

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

    final ApplicationFrame[][] frame = new ApplicationFrame[2][2];
    frame[0][0] = new SegmentedHighLowChartDemo("Segmented Daily High-Low-Open-Close Demo", true, 1);
    frame[1][0] = new SegmentedHighLowChartDemo("Normal Daily High-Low-Open-Close Demo", false, 1);
    frame[0][1] = new SegmentedHighLowChartDemo("Segmented Intraday High-Low-Open-Close Demo", true, 2);
    frame[1][1] = new SegmentedHighLowChartDemo("Normal Intraday High-Low-Open-Close Demo", false, 2);
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
            frame[i][j].pack();
            RefineryUtilities.positionFrameOnScreen(frame[i][j], .15 + .70 * j, .25 + .50 * i);
            frame[i][j].setVisible(true);
        }
    }

}

From source file:assig.Gantt.java

public Gantt(final String title, ArrayList<Process> p) {

    super(title);
    tit = title;//from   w  w  w  .jav  a 2s  .  co  m
    processArr = p;
    final GanttCategoryDataset dataset = createDataset();
    final JFreeChart chart = createChart(dataset);
    // add the chart to a panel...
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(750, 320));
    setContentPane(chartPanel);
    this.pack();
    RefineryUtilities.positionFrameOnScreen(this, 0.0, 0.95);
    this.setVisible(true);
}