Skip to content
Snippets Groups Projects
Commit 9cf25102 authored by Tim Molter's avatar Tim Molter
Browse files

new feature - allow customization of SwingWrapper Window Title

parent bce9ddf1
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment