diff --git a/xchart/src/main/java/com/xeiam/xchart/SwingWrapper.java b/xchart/src/main/java/com/xeiam/xchart/SwingWrapper.java index 5f51cf89306e7853db98853bcba960748de7e62d..14d2ae08211559e3e041c4a2ec8105f0dc89515e 100644 --- a/xchart/src/main/java/com/xeiam/xchart/SwingWrapper.java +++ b/xchart/src/main/java/com/xeiam/xchart/SwingWrapper.java @@ -29,6 +29,8 @@ import javax.swing.JPanel; */ public class SwingWrapper { + private String windowTitle = "XChart"; + private List<Chart> charts = new ArrayList<Chart>(); private int numRows; private int numColumns; @@ -70,13 +72,25 @@ public class SwingWrapper { this.numColumns = numColumns; } + /** + * Display the chart in a Swing JFrame + * + * @param windowTitle the title of the window + */ + public JFrame displayChart(String windowTitle) { + + this.windowTitle = windowTitle; + + return displayChart(); + } + /** * Display the chart in a Swing JFrame */ public JFrame displayChart() { // Create and set up the window. - final JFrame frame = new JFrame("XChart"); + final JFrame frame = new JFrame(windowTitle); // Schedule a job for the event-dispatching thread: // creating and showing this application's GUI. @@ -98,13 +112,26 @@ public class SwingWrapper { return frame; } + /** + * Display the charts in a Swing JFrame + * + * @param windowTitle the title of the window + * @return the JFrame + */ + public JFrame displayChartMatrix(String windowTitle) { + + this.windowTitle = windowTitle; + + return displayChartMatrix(); + } + /** * Display the chart in a Swing JFrame */ public JFrame displayChartMatrix() { // Create and set up the window. - final JFrame frame = new JFrame("XChart"); + final JFrame frame = new JFrame(windowTitle); // Schedule a job for the event-dispatching thread: // creating and showing this application's GUI.