// MJM 4/20/2017:  experimental test of local window image display

package erigo.ctscreencap;

import java.awt.*;
import java.awt.image.BufferedImage;
import javax.swing.*;

public class DisplayImage {

	public JFrame frame = null;
	private JLabel lbl = null;

	public DisplayImage(String title, Dimension initSize)
	{
		// For thread safety: Schedule a job for the event-dispatching thread to create and show the GUI
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				frame = new JFrame();
				frame.setTitle(title);
				lbl = new JLabel();
				JScrollPane scrollPane = new JScrollPane(lbl);
				scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
				scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
				frame.add(scrollPane,BorderLayout.CENTER);
				frame.setVisible(true);
				frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
				frame.setSize(initSize);
			}
		});
	}

	public void updateImage(BufferedImage img, int width, int height) {
		// For thread safety: Schedule a job for the event-dispatching thread to update the image on the JLabel
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				lbl.setSize(width, height);
				lbl.setIcon(new ImageIcon(img));
				lbl.repaint();
			}
		});
	}
}
@@ -1,204 +1,836 @@
 /
-/ MJM 4/20/2017:  experimental test of local window image display%0A%0Apackage erigo.ctscreencap;%0A%0Aimport java.awt.*;%0Aimport java.awt.image.BufferedImage;%0Aimport javax.swing.*;%0A%0Apublic class DisplayImage
+*%0ACopyright 2017 Cycronix%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A*/%0A%0Apackage erigo.ctscreencap;%0A%0Aimport java.awt.*;%0Aimport java.awt.image.BufferedImage;%0Aimport javax.swing.*;%0A%0A/**%0A * Popup a window to previewWindow the image that will be sent to CT%0A *%0A * @author Matt Miller, John Wilson%0A * @version 04/27/2017%0A *%0A */%0A%0Apublic class PreviewWindow
  %7B%0A%0A
@@ -899,20 +899,21 @@
 lic 
-DisplayImage
+PreviewWindow
 (Str

rename DisplayImage to be PreviewWindow